Page 1 of 1

rectangle color problem

Posted: 2009-03-04T20:26:11-07:00
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.

Re: rectangle color problem

Posted: 2009-03-09T15:58:25-07:00
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!!!!