I am trying to create an image with 4 pixels:
1 pixel in red color, 1 pixel in blue color, 1 pixel in green color, 1 pixel in white color
Code:
import wand.image
red = wand.image.Color('rgb(255,0,0)')
green = wand.image.Color('rgb(0,255,0)')
blue = wand.image.Color('rgb(0,0,255)')
white = wand.image.Color('rgb(255,255,255)')
myImage = wand.image.Image(width=2,height=2)
with wand.image.Image (myImage) as img:
img[0][0] = red
img[0][1] = blue
img[1][0] = green
img[1][1] = white
img.save(filename='out.png')
But it only creates a transparent png
. What am I doing wrong?