Page 2 of 2

Re: How to make reflected Image thumbnails

Posted: 2007-10-04T12:22:41-07:00
by richo
I just have .bat script in windows. I do not do building images online as my provider do not have imagemagick in php only db2.
Can you ask imagemagick to return (in batch file) some info about image (dimensions?)

Re: How to make reflected Image thumbnails

Posted: 2007-10-04T19:38:45-07:00
by anthony
Making it size dependant is a bit of a problem at the moment, as you can not use other image dimentions to set settings like -size. At least not yet. I have ideas about implementing it where you can use percent escapes, but backward compatibility is a problem ,as well as confusion about when the percent escape is actually substituted into the option setting.


If you can get the size of the final image into some variables you can then generate
a gradient at that size and then adjust the gradient image appropriatally.

Remember though we are not here to do your work for you, just give you pointers an clues on how to do it.

Re: How to make reflected Image thumbnails

Posted: 2007-10-05T05:21:29-07:00
by Bonzo
A few months ago I seem to remember you posting some way of using FX to set an image size Anthony.

Something like "convert original_image -size FX w h" and this will give you a canvas the same size as the original_image?

Re: How to make reflected Image thumbnails

Posted: 2007-10-06T17:32:31-07:00
by anthony
-fx always produces an image the same size as the first image. That is its nature.

The other ways to make a different sized image is to scale, do the calculations yourself.

Best idea... scale the original image, the use -fx to set up a basic linear gradient.

Code: Select all

convert image.png +matte -scale 100x20% -fx 'j/(h-1)'  gradient.png
OR closer to what you are after, copy the original image crop it then add
a linear gradient transparency directly. I'll even do the cloning, transparency level and appending for you. Only a distortion is needed the result and overlay on a background.

Code: Select all

convert image.png -matte  \
            \( +clone -flip -crop 100x20%+0+0 \
               -channel A -fx '1-j/(h-1)'  -evaluate multiply .3  \) \
           -append  ...add_distort_here...
          -bordercolor silver -border 10  reflected_image.png
NOTE: shortly a 3d rotation (a perspective variant) distort method will be available, which will mean you will not need to specify image size dependent coordinates to do the perspective distortion. The rotation algorithm is courtesy of Fred Weinhaus's 3d rotate scripts, and is being added to IM development sources in the next few days. See http://www.fmwconcepts.com/imagemagick/rotate3D/