Colored Canvas Washes Out Image

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
hknight
Posts: 32
Joined: 2007-08-02T10:16:15-07:00

Colored Canvas Washes Out Image

Post by hknight »

I want my image to be exactly 70px by 70px with a red canvas.

This does not work because the canvas is black:

Code: Select all

convert -size 70x70 xc:transparent null: ( rose: -thumbnail "70x70" +repage ( +clone -shave 10x10 -fill gray50 -colorize 100% -mattecolor gray50 -frame 10x10+3+4 -blur 0x2 ) -compose HardLight -composite ) -gravity Center -layers Composite -format jpg -unsharp 0x.5 -strip -quality 80 output1.jpg
This does not work because the image gets washed out with red:

Code: Select all

convert -size 70x70 xc:Red null: ( rose: -thumbnail "70x70" +repage ( +clone -shave 10x10 -fill gray50 -colorize 100% -mattecolor gray50 -frame 10x10+3+4 -blur 0x2 ) -compose HardLight -composite ) -gravity Center -layers Composite -format jpg -unsharp 0x.5 -strip -quality 80 output2.jpg
How can I have a canvas color other than transparent or black while maintaining the integrity of the image?
Bonzo
Posts: 2971
Joined: 2006-05-20T08:08:19-07:00
Location: Cambridge, England

Re: Colored Canvas Washes Out Image

Post by Bonzo »

The first piece of code will not works as jpg does not support transparnecy.

The second piece of code is confusing and I belive you do not need the null: or the -compose HardLight or the -format jpg probably not the -strip either. I do not know what effect you are after but I would start again one effect at a time.
hknight
Posts: 32
Joined: 2007-08-02T10:16:15-07:00

Re: Colored Canvas Washes Out Image

Post by hknight »

Bonzo, thanks, but your comments do not help. Firstly, the first piece of code DOES work with only one exception: the background is black. I want the background to be red. When I take out those things you suggested, it breaks.

How can I get a red canvas instead of a black canvas?

This is the effect I am after:
Image
User avatar
glennrp
Posts: 1147
Joined: 2006-04-01T08:16:32-07:00
Location: Maryland 39.26.30N 76.16.01W

Re: Colored Canvas Washes Out Image

Post by glennrp »

I'm not sure what you are trying to get, but you could try using "#FF000000" instead of "transparent" (that is, transparent red instead of opaque red) as the canvas.
hknight
Posts: 32
Joined: 2007-08-02T10:16:15-07:00

Re: Colored Canvas Washes Out Image

Post by hknight »

Adding the extra two zeros at the end works. Thanks!
Post Reply