draw RGBA png with unique pixel values, help?

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
alpay
Posts: 2
Joined: 2011-12-23T23:58:05-07:00
Authentication code: 8675308

draw RGBA png with unique pixel values, help?

Post by alpay »

Greetings, first time poster here.

I can't wrap my head around 2 problems. I'm using ImageMagick-6.7.4-Q16 on 64bit win7.

1- the commandline below does NOT draw the pixels at different color values, they all seems to be the same black value, and 2- when i load the png into photoshop, i expectedto see 4 channels (rgb and alpha) but it shows one single channel called bitmap (which is prob causing question 1 to occur, my guess). Any ideas? i have a feeling i'm just doing this plain wrong (a condition of being a noob). Thanks for the assistance.

Code: Select all

convert -size 500x1 xc:none -fill RGBA(32,106,111,0.00952381) -draw "point 1,1" -fill RGBA(110,105,110,0.00970874) -draw "point 2,1" -fill RGBA(32,80,97,0.00869565) -draw "point 3,1" -fill RGBA(116,119,97,0.00862069) -draw "point 4,1" -fill RGBA(99,104,46,0.03125) -draw "point 5,1" test.png
ps: my command is originally drawing 20 pixels, I reduced it to 5 so it'd be easier to look at. my hope is to draw much more than 20, maybe 500. would you guys suggest i use a different method, other than commandline for this task? thanks.

Alpay
User avatar
glennrp
Posts: 1147
Joined: 2006-04-01T08:16:32-07:00
Location: Maryland 39.26.30N 76.16.01W

Re: draw RGBA png with unique pixel values, help?

Post by glennrp »

row 1 is outside your image; it only has row 0.
Try -size 500x2 or point n,0 instead.

Also you may need to escape the "(" and ")" with backslashes or quotes. I put
quotes around the entire RGBA(r,g.b,a) like this:
  • glenn.rp> convert -size 6x1 xc:none \
    -fill "RGBA(32,106,111,0.00952381)" -draw "point 1,0" \
    -fill "RGBA(110,105,110,0.00970874)" -draw "point 2,0" \
    -fill "RGBA(32,80,97,0.00869565)" -draw "point 3,0" \
    -fill "RGBA(116,119,97,0.00862069)" -draw "point 4,0" \
    -fill "RGBA(99,104,46,0.03125)" -draw "point 5,0" \
    test.txt
    glenn.rp> cat test.txt
    # ImageMagick pixel enumeration: 6,1,65535,rgba
    0,0: ( 0, 0, 0, 0) #0000000000000000 none
    1,0: ( 8224,27242,28527, 624) #20206A6A6F6F0270 rgba(12.549%,41.5686%,43.5294%,0.00952163)
    2,0: (28270,26985,28270, 636) #6E6E69696E6E027C rgba(43.1373%,41.1765%,43.1373%,0.00970474)
    3,0: ( 8224,20560,24929, 570) #202050506161023A rgba(12.549%,31.3725%,38.0392%,0.00869764)
    4,0: (29812,30583,24929, 565) #7474777761610235 rgba(45.4902%,46.6667%,38.0392%,0.00862135)
    5,0: (25443,26728,11822, 2048) #636368682E2E0800 rgba(38.8235%,40.7843%,18.0392%,0.0312505)
    glenn.rp>
alpay
Posts: 2
Joined: 2011-12-23T23:58:05-07:00
Authentication code: 8675308

Re: draw RGBA png with unique pixel values, help?

Post by alpay »

Thanks Glennrp, I'll take a look at this now. Very much appreciated. enjoy your holidays and your new year.
Post Reply