Skip to content Skip to sidebar Skip to footer

Change Color Of Specific Pixels [wand]

So, I'm using Wand Python Library to mess around with some images. I just want it to look at an image, pixel by pixel, and for each pixel that is a specific color, say '4d4d4d', re

Solution 1:

If anyone is interested the python code would be something like this:

from wand.image import Image
from wand.drawing import Drawing
from wand.color import Color

with Drawing() as draw:
    draw.fill_color = Color('#00ff00')
    draw.color(x,y,'replace')
    with Image(filename='image.jpg') as img:
        draw(img)
        img.save(filename='new_image.jpg')

Post a Comment for "Change Color Of Specific Pixels [wand]"