Page 1 of 1

How to modify an image by custom image filter?

Posted: 2013-04-05T13:07:07-07:00
by egor7
I've read an architecture page http://www.imagemagick.org/script/architecture.php and found an example to modify some image properties:

Code: Select all

(void) SetImageProperty(image,"filter:saturation:skewness",text);
But I've failed to modify it pixels and failed to replace

Code: Select all

image=GetNextImageInList(image)
with a modified image clone.

So my question is - how to modify image pixels with -process Custom Image Filters.

Re: How to modify an image by custom image filter?

Posted: 2013-04-08T03:00:46-07:00
by egor7
I've done it! Many thanks for Image Toolkit - for custom filters!

Re: How to modify an image by custom image filter?

Posted: 2013-04-08T17:22:40-07:00
by anthony
Note that should probably be SetImageArtifact(...)

A properties are either coded attribute of an image (like its size), or extra data that is to be saved with the image.

Artifacts are similar (per image data) but is for working data, that will not be saved with images, they are typically used for coder and operational settings.



Future... In IMv6 Artifacts are typically directly set from global 'Options' (for CLI use) (repeatally copied). In IMv7 the GetImageArtifact() will simply look up the global "Option" if the requested per-image artifact is not set, and a link to the image-list the image is stored in has been set. This means in IMv7 you can set Options, and have per-image Artifacts override a global option for a specific image. This is in place, but still needing examples to demonstrate.

Summary... 4 meta-data stores of image data...
Attribute per-image, coded image data, like size, pixel data, background color.
Properity per-image free-form string data, to be saved with images (comments, labels, etc)
Artifact per-image working free-form string data, not to be saved (verbose, jpeg:size, compose:args, ...)
Option Global (image-list) free-form string data, to apply (as artifact) to all images.

The last is completely optional in MagickCore, and is more important to MagicWand and CLI interfaces.