Color?

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
mjn
Posts: 17
Joined: 2011-03-31T03:27:41-07:00
Authentication code: 8675308

Color?

Post by mjn »

convert -size 1024x1024 xc:transparent -fill transparent -stroke "#b82a21" -strokewidth 36 -draw "stroke-linejoin round polyline 334,82 690,82 942,334 942,690 690,942 334,942 82,690 82,334 334,82" result.png

The pixels in the above image turn out to be #b92728 instead of #b82a21. Why is that so? How can I draw with an *exact* colour?

Thanks, regards, Marcel
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Color?

Post by snibgo »

Trying your command on IM v6.8.6-8 in Windows 7, I get the correct colour, #b82a21.
snibgo's IM pages: im.snibgo.com
mjn
Posts: 17
Joined: 2011-03-31T03:27:41-07:00
Authentication code: 8675308

Re: Color?

Post by mjn »

I'm using IM 6.8.6-6 on OS X 10.8.4
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Color?

Post by snibgo »

I found the colour value with Gimp. How did you find #b92728?

Put your result.png on Dropbox or somewhere, and post the URL here.
snibgo's IM pages: im.snibgo.com
mjn
Posts: 17
Joined: 2011-03-31T03:27:41-07:00
Authentication code: 8675308

Re: Color?

Post by mjn »

snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Color?

Post by snibgo »

Gimp reports the colour as #b82a21. What tool are you using to find the colour?
snibgo's IM pages: im.snibgo.com
mjn
Posts: 17
Joined: 2011-03-31T03:27:41-07:00
Authentication code: 8675308

Re: Color?

Post by mjn »

Several. Acorn & ColorSnapper.
mjn
Posts: 17
Joined: 2011-03-31T03:27:41-07:00
Authentication code: 8675308

Re: Color?

Post by mjn »

I'm adding graphics with IM to an an image that was created with other graphical programs. And I can see a colour difference between the different elements, even though they all should all be the same. So, we can conclude that the problem is not with IM.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Color?

Post by fmw42 »

Turn off anti-aliasing otherwise you get some pixels that are blended with the transparency and its undercolor.

convert -size 1024x1024 xc:transparent -fill transparent -stroke "#b82a21" -strokewidth 36 +antialias -draw "stroke-linejoin round polyline 334,82 690,82 942,334 942,690 690,942 334,942 82,690 82,334 334,82" result2.png

convert result2.png -format "%c" histogram:info:
944536: ( 0, 0, 0, 0) #00000000 none
104040: (184, 42, 33,255) #B82A21 srgba(184,42,33,1)

IM 6.8.6.9 Q16 Mac OSX Snow Leopard
mjn
Posts: 17
Joined: 2011-03-31T03:27:41-07:00
Authentication code: 8675308

Re: Color?

Post by mjn »

Thanks, that's it!
Post Reply