Jump to content

Image resize / crop in effect plugin

Recommended Posts

Is it possible to resize or crop an image in an effect?  (or operate like the magic wand and set the current selection area?)   I am developing a plugin with a set of effects to help in my job, one of which is to quickly identify a dialog in a screenshot and crop it (see example image). Given that the overridden Render method is dealing with ROI's (regions of interest) and updating an equally sized destination surface from a source surface, I'm thinking that an effect may not be the best place for this functionality.  


(Workaround: I could get the effect to set everything but the dialog to a single color making the magic wand selection tool with a low tolerance, then a selection inversion, able to identify the region to 'Crop to selection' work cleanly.)




Link to comment
Share on other sites

Hello Bruce - welcome to the forum!

As I understand, you cannot change the selection or canvas size from within a plugin.
The plugin rules are here btw:

On my 'Composition tool' plugin I change the unwanted areas to transparent white (bgra = 255,255,255,0) . Once the plugin has run, the user can select this area, invert the selection and crop to selection.


Hope that helps


Red ochre Plugin pack.............. Diabolical Drawings ................Real Paintings



Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...