Problem with generating reflection
Problem with generating reflection
Trying the example titled ' Gradient Attenuation' at
http://www.imagemagick.org/Usage/advanced/#reflections doesn't seem to work for me on a mac with version '6.7.9-0' using the same example image as on the webpage.
A black bar appears instead of the reflected image. Any ideas if it's platform/installation specific or anything else?
thanks!
http://www.imagemagick.org/Usage/advanced/#reflections doesn't seem to work for me on a mac with version '6.7.9-0' using the same example image as on the webpage.
A black bar appears instead of the reflected image. Any ideas if it's platform/installation specific or anything else?
thanks!
Re: Problem with generating reflection
It works for me on Mac OS X Lion with the same version number (installed via 'MacPorts'):ssaann wrote:Trying the example titled ' Gradient Attenuation' at
http://www.imagemagick.org/Usage/advanced/#reflections doesn't seem to work for me on a mac with version '6.7.9-0' using the same example image as on the webpage.
Code: Select all
Version: ImageMagick 6.7.9-0 2012-08-17 Q16 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2012 ImageMagick Studio LLC
Features: OpenCL HDRI
Code: Select all
sudo port -p install ImageMagick +graphviz+hdri+jbig+jpeg2+lqr+mpeg+pango+perl+q16+rsvg+wmf
Which is your Mac OS X version?
How did you install your ImageMagick?
What's the exact version of ImageMagick? Please provide the full output of
Code: Select all
convert -version
Code: Select all
convert -list configure
How did you try to view your output?ssaann wrote:A black bar appears instead of the reflected image. Any ideas if it's platform/installation specific or anything else?
For me the output looks Ok in 'Preview.app' as well as with ImageMagick's own 'display', just like the original one:
Re: Problem with generating reflection
I am on latest Mountain Lion, I reinstalled IM with same command as you used, earlier I had used - 'sudo port -p install ImageMagick'.
Now i used - 'sudo port -p install ImageMagick +graphviz+hdri+jbig+jpeg2+lqr+mpeg+pango+perl+q16+rsvg+wmf'
My version:
Version: ImageMagick 6.7.9-0 2012-08-22 Q16 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2012 ImageMagick Studio LLC
Features: OpenCL HDRI
Output from:
$convert -list configure
Path: /opt/local/lib/ImageMagick-6.7.9/config/configure.xml
Name Value
-------------------------------------------------------------------------------
CC /usr/bin/clang
CFLAGS -I/opt/local/include/lqr-1 -I/opt/local/include/glib-2.0 -I/opt/local/lib/glib-2.0/include -I/opt/local/include -pipe -O2 -arch x86_64 -Wall -D_THREAD_SAFE -pthread
CODER_PATH /opt/local/lib/ImageMagick-6.7.9/modules-Q16/coders
CONFIGURE ./configure '--prefix=/opt/local' '--enable-shared' '--enable-static' '--disable-ltdl-install' '--with-frozenpaths' '--with-dps' '--with-bzlib' '--with-fontconfig' '--with-gslib' '--with-jpeg' '--with-lcms' '--with-png' '--with-tiff' '--with-webp' '--with-zlib' '--with-modules' '--with-xml' '--with-x' '--without-fpx' '--with-gs-font-dir=/opt/local/share/fonts/urw-fonts' '--with-gvc' '--with-openexr' '--enable-hdri' '--with-jbig' '--with-jp2' '--with-lqr' '--with-pango' '--with-perl=/opt/local/bin/perl' '--with-quantum-depth=16' '--with-rsvg' '--with-wmf' 'CC=/usr/bin/clang' 'CFLAGS=-pipe -O2 -arch x86_64' 'LDFLAGS=-L/opt/local/lib -arch x86_64' 'CPPFLAGS=-I/opt/local/include' 'CXX=/usr/bin/clang++' 'CXXFLAGS=-pipe -O2 -arch x86_64'
CONFIGURE_PATH /opt/local/etc/ImageMagick/
COPYRIGHT Copyright (C) 1999-2012 ImageMagick Studio LLC
CPPFLAGS -I/opt/local/include/ImageMagick
CXX /usr/bin/clang++
CXXFLAGS -pipe -O2 -arch x86_64 -D_THREAD_SAFE -pthread
DEFS -DHAVE_CONFIG_H
DELEGATES bzlib fftw fontconfig freetype gs gvc jbig jpeg jng jp2 lcms2 lqr lzma openexr pango png rsvg tiff x11 xml wmf zlib
DISTCHECK_CONFIG_FLAGS 'CC=/usr/bin/clang' 'CFLAGS=-pipe -O2 -arch x86_64' 'CPPFLAGS=-I/opt/local/include' 'CXX=/usr/bin/clang++' 'LDFLAGS=-L/opt/local/lib -arch x86_64' --disable-deprecated --with-quantum-depth=16 --with-umem=no --with-autotrace=no --with-fpx=no --with-fontpath= --with-gs-font-dir=/opt/local/share/fonts/urw-fonts --with-perl=/opt/local/bin/perl
DOCUMENTATION_PATH /opt/local/share/doc/ImageMagick-6.7.9
EXEC-PREFIX /opt/local
EXECUTABLE_PATH /opt/local/bin
FEATURES HDRI OpenCL
FILTER_PATH /opt/local/lib/ImageMagick-6.7.9/modules-Q16/filters
HOST x86_64-apple-darwin12.0.0
INCLUDE_PATH /opt/local/include/ImageMagick
LDFLAGS -L/opt/local/lib -L/opt/local/lib -arch x86_64 -L/opt/local/lib -L/opt/local/lib
LIB_VERSION 0x679
LIB_VERSION_NUMBER 6,7,9,0
LIBRARY_PATH /opt/local/lib/ImageMagick-6.7.9
LIBS -lMagickCore -llcms2 -ltiff -lfreetype -ljpeg -L/opt/local/lib -llqr-1 -lglib-2.0 -lintl -lfftw3 -L/opt/local/lib -lfontconfig -lXext -lSM -lICE -lX11 -lXt -L/opt/local/lib -llzma -lbz2 -lz -lm -Wl,-framework,OpenCL -lpthread -lltdl
NAME ImageMagick
PCFLAGS
PREFIX /opt/local
QuantumDepth 16
RELEASE_DATE 2012-08-22
SHARE_PATH /opt/local/share/ImageMagick-6.7.9
SVN_REVISION 8971
TARGET_CPU x86_64
TARGET_OS darwin12.0.0
TARGET_VENDOR apple
VERSION 6.7.9
WEBSITE http://www.imagemagick.org
Path: [built-in]
Name Value
-------------------------------------------------------------------------------
NAME ImageMagick
Ran this command as is -
$convert pokemon.gif -alpha on \( +clone -flip -size 64x28 gradient:gray40-black -alpha off -compose CopyOpacity -composite \) -append -gravity North -crop 100x100+0-5\! -background black -compose Over -flatten reflect_attenuated.png
It generates this image -
http://www.tiikoni.com/tis/view/?id=446537b
This image doesn't show any reflection in preview.app or any other viewers.
Now i used - 'sudo port -p install ImageMagick +graphviz+hdri+jbig+jpeg2+lqr+mpeg+pango+perl+q16+rsvg+wmf'
My version:
Version: ImageMagick 6.7.9-0 2012-08-22 Q16 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2012 ImageMagick Studio LLC
Features: OpenCL HDRI
Output from:
$convert -list configure
Path: /opt/local/lib/ImageMagick-6.7.9/config/configure.xml
Name Value
-------------------------------------------------------------------------------
CC /usr/bin/clang
CFLAGS -I/opt/local/include/lqr-1 -I/opt/local/include/glib-2.0 -I/opt/local/lib/glib-2.0/include -I/opt/local/include -pipe -O2 -arch x86_64 -Wall -D_THREAD_SAFE -pthread
CODER_PATH /opt/local/lib/ImageMagick-6.7.9/modules-Q16/coders
CONFIGURE ./configure '--prefix=/opt/local' '--enable-shared' '--enable-static' '--disable-ltdl-install' '--with-frozenpaths' '--with-dps' '--with-bzlib' '--with-fontconfig' '--with-gslib' '--with-jpeg' '--with-lcms' '--with-png' '--with-tiff' '--with-webp' '--with-zlib' '--with-modules' '--with-xml' '--with-x' '--without-fpx' '--with-gs-font-dir=/opt/local/share/fonts/urw-fonts' '--with-gvc' '--with-openexr' '--enable-hdri' '--with-jbig' '--with-jp2' '--with-lqr' '--with-pango' '--with-perl=/opt/local/bin/perl' '--with-quantum-depth=16' '--with-rsvg' '--with-wmf' 'CC=/usr/bin/clang' 'CFLAGS=-pipe -O2 -arch x86_64' 'LDFLAGS=-L/opt/local/lib -arch x86_64' 'CPPFLAGS=-I/opt/local/include' 'CXX=/usr/bin/clang++' 'CXXFLAGS=-pipe -O2 -arch x86_64'
CONFIGURE_PATH /opt/local/etc/ImageMagick/
COPYRIGHT Copyright (C) 1999-2012 ImageMagick Studio LLC
CPPFLAGS -I/opt/local/include/ImageMagick
CXX /usr/bin/clang++
CXXFLAGS -pipe -O2 -arch x86_64 -D_THREAD_SAFE -pthread
DEFS -DHAVE_CONFIG_H
DELEGATES bzlib fftw fontconfig freetype gs gvc jbig jpeg jng jp2 lcms2 lqr lzma openexr pango png rsvg tiff x11 xml wmf zlib
DISTCHECK_CONFIG_FLAGS 'CC=/usr/bin/clang' 'CFLAGS=-pipe -O2 -arch x86_64' 'CPPFLAGS=-I/opt/local/include' 'CXX=/usr/bin/clang++' 'LDFLAGS=-L/opt/local/lib -arch x86_64' --disable-deprecated --with-quantum-depth=16 --with-umem=no --with-autotrace=no --with-fpx=no --with-fontpath= --with-gs-font-dir=/opt/local/share/fonts/urw-fonts --with-perl=/opt/local/bin/perl
DOCUMENTATION_PATH /opt/local/share/doc/ImageMagick-6.7.9
EXEC-PREFIX /opt/local
EXECUTABLE_PATH /opt/local/bin
FEATURES HDRI OpenCL
FILTER_PATH /opt/local/lib/ImageMagick-6.7.9/modules-Q16/filters
HOST x86_64-apple-darwin12.0.0
INCLUDE_PATH /opt/local/include/ImageMagick
LDFLAGS -L/opt/local/lib -L/opt/local/lib -arch x86_64 -L/opt/local/lib -L/opt/local/lib
LIB_VERSION 0x679
LIB_VERSION_NUMBER 6,7,9,0
LIBRARY_PATH /opt/local/lib/ImageMagick-6.7.9
LIBS -lMagickCore -llcms2 -ltiff -lfreetype -ljpeg -L/opt/local/lib -llqr-1 -lglib-2.0 -lintl -lfftw3 -L/opt/local/lib -lfontconfig -lXext -lSM -lICE -lX11 -lXt -L/opt/local/lib -llzma -lbz2 -lz -lm -Wl,-framework,OpenCL -lpthread -lltdl
NAME ImageMagick
PCFLAGS
PREFIX /opt/local
QuantumDepth 16
RELEASE_DATE 2012-08-22
SHARE_PATH /opt/local/share/ImageMagick-6.7.9
SVN_REVISION 8971
TARGET_CPU x86_64
TARGET_OS darwin12.0.0
TARGET_VENDOR apple
VERSION 6.7.9
WEBSITE http://www.imagemagick.org
Path: [built-in]
Name Value
-------------------------------------------------------------------------------
NAME ImageMagick
Ran this command as is -
$convert pokemon.gif -alpha on \( +clone -flip -size 64x28 gradient:gray40-black -alpha off -compose CopyOpacity -composite \) -append -gravity North -crop 100x100+0-5\! -background black -compose Over -flatten reflect_attenuated.png
It generates this image -
http://www.tiikoni.com/tis/view/?id=446537b
This image doesn't show any reflection in preview.app or any other viewers.
Re: Problem with generating reflection
Ok, I can confirm what you see -- the following command does NOT work to create the reflection when using v6.7.9-0 Q16 (it DID work in v6.7.6-9 though):
Using '-alpha on' in the clone does make the refection visible, but it's without the transparency of course.
Switching over to my (selfcompiled) version v6.7.6-9 Q16 has this same command working.
The command which I had used (and which still works on v6.7.9-0 Q16, producing the reflection image in my previous answer) is this:
Code: Select all
convert \
pokemon.gif \
-alpha on \
\( \
+clone \
-flip \
-size 64x28 \
gradient:gray40-black \
-alpha off \
-compose CopyOpacity \
-composite \
\) \
-append \
-gravity North \
-crop 100x100+0-5\! \
-background black \
-compose Over \
-flatten \
reflect_attenuated.png
Switching over to my (selfcompiled) version v6.7.6-9 Q16 has this same command working.
The command which I had used (and which still works on v6.7.9-0 Q16, producing the reflection image in my previous answer) is this:
Code: Select all
convert \
pokemon.gif \
\( \
+clone \
-flip \
-fill black \
-colorize 65% \
\) \
-append \
-size 100x100 \
xc:black \
+swap \
-gravity North \
-geometry +0+5 \
-composite \
reflect_colored.png
Re: Problem with generating reflection
Upon closer look, the problem seems to be connected with the 'gradient:gray40-black' part of the command. Replacing this with 'gradient:white-black' made it work (but of course, it isn't the wanted output...).pipitas wrote:Ok, I can confirm what you see -- the following command does NOT work to create the reflection when using v6.7.9-0 Q16 (it DID work in v6.7.6-9 though):
Code: Select all
convert \ pokemon.gif \ -alpha on \ \( \ +clone \ -flip \ -size 64x28 \ gradient:gray40-black \ -alpha off \ -compose CopyOpacity \ -composite \ \) \ -append \ -gravity North \ -crop 100x100+0-5\! \ -background black \ -compose Over \ -flatten \ reflect_attenuated.png
'gradient:gray70-black' also works, for example. It produces a similar result as 'gradient:gray40-black' did in v6.7.6-9 for the brighter part of the reflection, but the gradient does much more quickly fade into black here.
Since both versions do produce the very same PNG output with 'convert -size 64x28 :gray40-black gradient.png' I think the change comes from a different behavior of the 'compose Over' part of the command...
Re: Problem with generating reflection
thanks for trying it out
Yes with gradient:gray70-black it works but the result is not what I want.
Is there another way to apply gradient fade to the image and maybe I can pipeline multiple steps to crop and combine images?
Yes with gradient:gray70-black it works but the result is not what I want.
Is there another way to apply gradient fade to the image and maybe I can pipeline multiple steps to crop and combine images?
Re: Problem with generating reflection
Did you try the command I originally used to test? This one:ssaann wrote:Is there another way to apply gradient fade to the image and maybe I can pipeline multiple steps to crop and combine images?
Code: Select all
convert \
pokemon.gif \
\( \
+clone \
-flip \
-fill black \
-colorize 65% \
\) \
-append \
-size 100x100 xc:black \
+swap \
-gravity North \
-geometry +0+5 \
-composite \
reflect_colored.png
Re: Problem with generating reflection
But that one doesn't produce a gradient in the reflection, which gradually fades/blurs out, or does it?
for me it creates a reflection that goes up to the bottom of image without any gradient..
for me it creates a reflection that goes up to the bottom of image without any gradient..
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Problem with generating reflection
This works for me, note the size must be 64x64 not 64x28
convert pokemon.gif -alpha on \
\( +clone -flip \( -size 64x64 gradient:"gray70-black" \) -alpha off -compose Copy_Opacity -composite \) \
-append -gravity North -crop 100x100+0-5\! -background black -compose Over -flatten pokemon_reflect_attenuated.png
convert pokemon.gif -alpha on \
\( +clone -flip \( -size 64x64 gradient:"gray70-black" \) -alpha off -compose Copy_Opacity -composite \) \
-append -gravity North -crop 100x100+0-5\! -background black -compose Over -flatten pokemon_reflect_attenuated.png
Re: Problem with generating reflection
This should do, works great!
thanks a lot for your help. much appreciated..
thanks a lot for your help. much appreciated..
Re: Problem with generating reflection
Found another solution from here for someone looking for it -
viewtopic.php?f=1&t=15371
viewtopic.php?f=1&t=15371
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Problem with generating reflection
Yes, those were my responses/solutions also.ssaann wrote:Found another solution from here for someone looking for it -
viewtopic.php?f=1&t=15371