How to modify an image by custom image filter?

Questions and postings pertaining to the development of ImageMagick, feature enhancements, and ImageMagick internals. ImageMagick source code and algorithms are discussed here. Usage questions which are too arcane for the normal user list should also be posted here.
Post Reply
egor7
Posts: 5
Joined: 2012-05-28T22:06:27-07:00
Authentication code: 13

How to modify an image by custom image filter?

Post 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.
egor7
Posts: 5
Joined: 2012-05-28T22:06:27-07:00
Authentication code: 13

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

Post by egor7 »

I've done it! Many thanks for Image Toolkit - for custom filters!
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

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

Post 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.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
Post Reply