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
This small module adresses this problem by letting you pass any argument to image module, parameters pass via query string
and you using them you can override any style parameters on the fly.
All you have to do is to use image_style_argument_url instead of image_style_url when generating the image url
For full documentation please read README.txt
$style_override = array('effects' => array(
9 => array ( //Overlay (watermark)
'data' => array (
'path' => 'public://my_frame.jpg'
image_style_argument_url('style_name', 'public://myimage.jpg', $style_override);