rectangle color problem

Post any defects you find in the released or beta versions of the ImageMagick software here. Include the ImageMagick version, OS, and any command-line required to reproduce the problem. Got a patch for a bug? Post it here.
Post Reply
ariel

rectangle color problem

Post by ariel »

Hi!

I run this command in php to create a rectangular shape and with yellow and blue color.

Code: Select all

-stroke yellow -draw "stroke-dasharray 5 3 stroke-dashoffset 7.5 stroke-width 1.5 rectangle 12.5,12.5 362.5,212.5" -stroke blue -draw "stroke-dasharray 5 3 stroke-dashoffset 7.5 stroke-width 0.25 rectangle 12.5,12.5 362.5,212.5"
But when output image generated it seems that some the color of the rectangle is different from the color I assigned in the codes.

Is a float number for the points of the rectangle affects the color?

Any help will be highly appreciated.

Thank you.
Last edited by ariel on 2009-03-11T13:58:47-07:00, edited 1 time in total.
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: rectangle color problem

Post by anthony »

If you save as JPEG then the colors will never be exact!

Also anti-aliasing pixels may produce mixed colors.

I can't really tell as when I try the above example on a test image I don't see a useful result. Your stroke-width may be too small.

When I adjusted I noticed you draw yellow then overlay it completely with blue!
so no yellow appears in the output...

Code: Select all

 convert logo: -stroke yellow -strokewidth 3 -draw "stroke-dasharray 5 3 stroke-dashoffset 7.5 rectangle 12.5,12.5 362.5,212.5" -stroke blue -draw "stroke-dasharray 5 3 stroke-dashoffset 7.5 rectangle 12.5,12.5 362.5,212.5" show:
On the other hand.....

Code: Select all

convert logo: -stroke yellow -strokewidth 3 -draw "rectangle 12.5,12.5 362.5,212.5" -stroke blue -draw "stroke-dasharray 5 3 stroke-dashoffset 7.5 rectangle 12.5,12.5 362.5,212.5" show:
should have draw a yellow border, then overlaied a blue dashes, and it didn't.

And that is a bug!!!!
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
Post Reply