I'm able to get a list of fields using

$fields = array_keys(\Drupal::entityManager()->getFieldDefinitions('node', 'ce_meeting'));

But is there a way to get a list of Image Styles instead? Something similar to

$fields = array_keys(\Drupal::entityManager()->getImageStyles());

to spit out an array


Is there a function to display a list of available image styles?

3 Answers 3



use Drupal\image\Entity\ImageStyle;

and load all image style with

$styles = ImageStyle::loadMultiple();

Also you can use entity_load_multiple with

 styles = \Drupal::entityTypeManager()->getStorage('image_style')->loadMultiple();

You can get a list of all image styles with an entity query:

$image_styles = \Drupal::entityQuery('image_style')

If you query the config entity image_style, you get an array with a list of available image styles.

If you use loadMultiple() on the config entity, you get an array with the loaded config objects. Use this, if you need the configurations.

If you only need a list, use entity query, because this is faster.


If you'd like to get it with Drush on the CLI, use:

drush ev "print_r(array_keys(\Drupal::entityTypeManager()->getStorage('image_style')->loadMultiple()));"

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.