how to set the pixel outside image ? virtual pixel magick++

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
EA_User

how to set the pixel outside image ? virtual pixel magick++

Post by EA_User »

Hello,

I try to use magick++ for basic convolution and similarity measures for pixel.

My question is how can i set the implicite values for pixel outside the image ?
How can i set it to "mirror/reflexion signal", "copy signal from nearest pixel" and other basic implicits considerations ?
I read some documentation on web but i don't found or understand how to set it for magick++.



Sorry if the question was already discuss (i don't found it), and for my english.
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: how to set the pixel outside image ? virtual pixel magick++

Post by anthony »

the setting is called -virtual-pixel, and you can list the posible settings using

Code: Select all

   convert -list virtual-pixel
For a exampled summery see...

http://www.imagemagick.org/Usage/misc/#virtual

I am not positive this is used for -convolve but it is used for -blur and -gaussian. It is also vital for image distortions and -fx lookups that 'miss' the image proper, as you can see by the above examples.

The other alternative is to expand your image to surround the edges of the image with some pattern of your own choice.


I have not added much for convolution in IM Examples yet, not even a discussion of 'neighbourhoods' and standard distribution curves common to these type of functions. See
http://www.imagemagick.org/Usage/convolve
If you like to help prehaps you can contribute some info or section on convolution in IM, what it does and how you can use it (with appropriate small examples).

WARNING: As I have not tested -convolve much, there may be bugs or features I don't know about, or have yet discovered, caution is recommended.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
EA_User

Re: how to set the pixel outside image ? virtual pixel magick++

Post by EA_User »

Thank for reply,
But I already read your (usefull) exemples for magik as command line tools.
Here my subject is for magick++ : how can i use properly these technics in c++ program ?

For magik wand, there are something relative to virtual pixel too, but i don't found it with magik++.
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: how to set the pixel outside image ? virtual pixel magick++

Post by anthony »

It will be present somewhere. Hmmm...
From the command line API source file "wand/mogrify.c" search for "virtual-pixel" It calls the MagickCore Library procedure SetImageVirtualPixelMethod().
Magick++ should have something simular if not the same
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
Post Reply