Hi all
v.6.3.3
I have some difficulties with shadow.
It works good with png, but I don't use it for thumbnails but for 640x480 sized pictures but the filesize increases very fast, some pictures make it over 1MB in png.
If I try flattening to jpg, the shadow just disappears and I'm having a grey area around my picture.
Here is the code snipplets:
convert in.jpg -size 800x600 -quality 90 -bordercolor \ white -border 20 -gravity center -extent 640x640 \ +repage -bordercolor grey -border 1 -flatten \
\( +clone -shadow 30x10+10+10 \) \
+swap -background none -flatten -depth 8 out.jpg
however it works using png as output, but not with jpg
any hints?
best regards and thanks
Patrick
How to have shadow in a .jpg [solved]
How to have shadow in a .jpg [solved]
Last edited by jaano on 2007-03-27T23:35:56-07:00, edited 2 times in total.
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
Re: Schadow influences filesize and howto have one in a .jpg?
JPEG does not allow transparency. Flattening to a background of NONE is useless
The shadow dissappears because ALL the background which was partically semi-transparent grey, becomes opaque grey when you save to JPEG. That is the whole background becomes shadow!
Change the final 'none' to white or some other color and the shadow will reappear as you nolonger have semi-transparent grey shadow, but various shades from white to grey.
The shadow dissappears because ALL the background which was partically semi-transparent grey, becomes opaque grey when you save to JPEG. That is the whole background becomes shadow!
Change the final 'none' to white or some other color and the shadow will reappear as you nolonger have semi-transparent grey shadow, but various shades from white to grey.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/
Re: Schadow influences filesize and howto have one in a .jpg?
actually that still gives the same result! both ways! background none and background white!
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
Re: Schadow influences filesize and howto have one in a .jpg?
Opps reading JPEG also does not give you a transparency to work with. Also add -matter just afetr reading the JPEg image. You also have too many -flattens and never actually set a background color for the shadow.
Code: Select all
convert injpg -matte \
-bordercolor white -border 20 \
-gravity center -extent 640x640 \
-bordercolor grey -border 1 \
\( +clone -background black -shadow 30x5+10+10 \) \
+swap -background white -flatten \
-quality 90 out.jpg
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/
Re: Schadow influences filesize and howto have one in a .jpg?
Thank you for your help, the -matte option made it work.