Graphicsmagick or pgmagick fill

Question

How can I use a fill fill using the Graphicsmagick command line or its pgmagick shell for python?

Background

So far this is what I have, but his claim that the signatures do not match:

Code:
from pgmagick import Image, ColorRGB

img = Image('C:\\test.png')
cRGB = ColorRGB(256.0, 256.0, 256.0)
geo = Geometry(1,1)
img.floodFillColor(geo, cRGB, cRGB)
Mistake:
  File "C: / Dropbox / COC / automate / coc_automate / python / __ init__.py", line 62, in take_main_screen_shot
    img.floodFillColor (geo, cRGB, cRGB)
Boost.Python.ArgumentError: Python argument types in
    Image.floodFillColor (Image, Geometry, ColorRGB, ColorRGB)
did not match C ++ signature:
    floodFillColor (class Magick :: Image {lvalue}, class Magick :: Geometry, class Magick :: Color, class Magick :: Color)
    floodFillColor (class Magick :: Image {lvalue}, class Magick :: Geometry, class Magick :: Color)

Extra

, , Python Windows, . , .

+4
2

Python Imaging Library (PIL)

.

import Image, ImageDraw

im = Image.open("lena.pgm")

draw = ImageDraw.Draw(im)
draw.line((0, 0) + im.size, fill=128)
draw.line((0, im.size[1], im.size[0], 0), fill=128)
del draw 

# write to stdout
im.save(sys.stdout, "PNG")
+1

, . pgmagick - Python ++, , , . , , , .

pgmagick ImageMagick, GraphicsMagick, . , . , , , :

  • , RGBColor

    from pgmagick import Color
    color = Color('white')
    
  • 0 :

    from pgmagick import Geometry
    geo = Geometry(0, 0, 1, 1)
    
  • , Color floodFillColor, fillColor, floodFillColor, :

    img.fillColor(color)
    img.floodFillColor(geo, color)
    
+1

All Articles