Drupal has a very powerful image manipulation UI, so why write code when we can easily use that for any purpose?!
The problem is we can't! The reason is image manipulation UI only accepts one argument which is the source image.
All other parameters and options are static. For example if you want to put the source image behind a frame you can,
but if you want to dynamically change frame's image you either have to make new preset/style for each different frame
or write a custom special action.

Another example is rendering texts dynamically, you can pass any text you want to the image style and have it rendered without writing any custom action

The ideal solution is proper argument support by drupal's core image module , something like Views arguments
Also it's not currently possible to use tokens or context in image styles/presets. One of the advantages of token support is to use parameters of the last effect
in the next one. For example we can scale an image by width and then use the new height size to crop image's width and height in the next effect. This also opens up the possibility
to have much smarter effects and combine them together like Color detector, it can detect the major colors used in an image and when can use the most used one as the image's background color or color filter!

Comments

theduke’s picture

+1 for dynamic arguments for image styles, this becomes important in various scenarios.

I needed this functionality on multiple sites.

rooby’s picture

Version: 7.x-dev » 8.0.x-dev
Issue summary: View changes

I assume this sandbox is relevant to this issue: https://www.drupal.org/sandbox/sinasalek/1715318

TechNikh’s picture

+1

Version: 8.0.x-dev » 8.1.x-dev

Drupal 8.0.6 was released on April 6 and is the final bugfix release for the Drupal 8.0.x series. Drupal 8.0.x will not receive any further development aside from security fixes. Drupal 8.1.0-rc1 is now available and sites should prepare to update to 8.1.0.

Bug reports should be targeted against the 8.1.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.2.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.1.x-dev » 8.2.x-dev

Drupal 8.1.9 was released on September 7 and is the final bugfix release for the Drupal 8.1.x series. Drupal 8.1.x will not receive any further development aside from security fixes. Drupal 8.2.0-rc1 is now available and sites should prepare to upgrade to 8.2.0.

Bug reports should be targeted against the 8.2.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.3.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.2.x-dev » 8.3.x-dev

Drupal 8.2.6 was released on February 1, 2017 and is the final full bugfix release for the Drupal 8.2.x series. Drupal 8.2.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.3.0 on April 5, 2017. (Drupal 8.3.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.3.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.4.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.