finding images within an image & excluding them from filters
Posted: 2011-10-04T14:22:31-07:00
Hi,
I have something I'd like to do with ImageMagick, but I'm not sure where to start, or if it's even possible.
Given a source image, for example like this:
... and a "search image", for example like this:
...the ImageMagick script should be able apply some arbitrary filter/effect (like e.g. desaturating) to the source image, but all occurrences of the "search image" within the source image should stay like they were originally:
Given assumptions:
Note that I'd settle for a pragmatic approximation, like e.g. a solution that breaks the anti-aliased edges but otherwise does the job.
I have something I'd like to do with ImageMagick, but I'm not sure where to start, or if it's even possible.
Given a source image, for example like this:
... and a "search image", for example like this:
...the ImageMagick script should be able apply some arbitrary filter/effect (like e.g. desaturating) to the source image, but all occurrences of the "search image" within the source image should stay like they were originally:
Given assumptions:
- The source image is fully opaque.
- The "search image" is non-rectangular, and may contain semi-transparency for anti-aliased edges (but other than that, no semi-transparent areas)
- All occurences of the "search image" are fully contained in the source image, and don't overlap
Note that I'd settle for a pragmatic approximation, like e.g. a solution that breaks the anti-aliased edges but otherwise does the job.