Questions tagged [pycairo]

A set of Python bindings for the cairo graphics library.

Pycairo is a set of Python bindings for the cairo graphics library.

Useful links:

252 questions
0
votes
1 answer

pyCairo Stack images

I'm using pycairo to compose images. Currently I am creating my ImageSurface from a base image and setting a Context from this Surface. surface = cairo.ImageSurface.create_from_png("base.png") ctx = cairo.Context (surface) Then I can for example…
user2261062
0
votes
1 answer

IOError when installing pycairo on Python 2.7 environment

When I try to install matplotlib into my Python 2.7 environment, pycairo gives me the following error: $ conda install matplotlib Fetching package metadata ......... Solving package specifications: . Package plan for installation in environment…
takachanbo
  • 633
  • 2
  • 6
  • 15
0
votes
0 answers

Wrapping and extending python cairo library with cython

I am writing a python program to do graphic animations, I am using the python cairo/rsvg libraries. I have reached a speed issue and wanted to accelerate some parts of the code by moving some of the rendering code in a cython library. Ideally I…
yann.kmm
  • 827
  • 7
  • 21
0
votes
0 answers

Empty SVG file errror while it's not

Working with Pycairo, I create an "SVGSurface" (which create for me an svg file) and I write on it using a "context". Now after I finish, I need to use the svg file, but it seems that the file is not closed so that it gave me an error telling that…
0
votes
0 answers

igraph plotting with cairo error

I am trying to create a plot with python igraph: from igraph import * vertices = ["one", "two", "three"] edges = [(0,2),(2,1),(0,1)] g = Graph(vertex_attrs={"label": vertices}, edges=edges, directed=True) plot(g) I have installed all of…
crysis405
  • 1,121
  • 2
  • 13
  • 26
0
votes
0 answers

Pygal not rendering Legend properly in PNG

I am trying to render a chart in PNG format, because this image is going to be embed in a email template and SVG are not supported on every email client, when I render the chart in SVG format it looks quite fine but when I render on PNG, the chart…
Cheluis
  • 1,402
  • 3
  • 22
  • 51
0
votes
1 answer

install python cairo on OS X

I want to run some library which uses cairocffi package. However, when I try to run it I get: OSError: dlopen() failed to load a library: cairo / cairo-2 / So I've installed cairo using 'brew install cairo'. Then I tried to install py2cairo…
mstechly
  • 15
  • 8
0
votes
1 answer

Python + Pycharm = pbm installing lxml & cairosvg 'Directory not owned by current user'

Using Pycharm, I am trying to install Pygall, which needs lxml and cairosvg. I created a 'requirements.txt' file to list the modules: Executed command : pip install lxml Error: 0:425: execution error: The directory…
Romain Jouin
  • 4,448
  • 3
  • 49
  • 79
0
votes
1 answer

Build of py2cairo fails in Mac OS X with Homebrew

I've made the debatable decision to do some network analysis directly in Python instead of R. However, I'm having trouble getting all the igraph dependencies installed, ultimately failing with py2cairo. After updating Xcode to latest, installed…
tchaymore
  • 3,728
  • 13
  • 55
  • 86
0
votes
2 answers

Using Pycairo to generate images dynamically and serve in Django

I want to generate a dynamically created png image with Pycairo and serve it usign Django. I read this: Serve a dynamically generated image with Django. Is there a way to transport data from Pycairo surface directly into HTTP response? I'm doing…
huggie
  • 17,587
  • 27
  • 82
  • 139
0
votes
1 answer

How to select fonts more specifically in cairo?

In cairo, fonts can be specified by their family name, e.g. 'HelveticaNeueLTStd'. Then, weights and styles can be defined by cairo.FONT_WEIGHT_[NORMAL|BOLD] and cairo.FONT_SLANT_[NORMAL|OBLIQUE|ITALIC], which are constants with integer values. Only…
deeenes
  • 4,148
  • 5
  • 43
  • 59
0
votes
1 answer

Convert SVG to PDF using Python, rsvg & Cairo

I have managed to read SVG using rsvg and output it to PNG via Cairo, in Python. Despite there being MANY similar questions, I've not seen any documentation on how to convert SVG into PDF through rsvg & cairo. I am aware of the command-line…
Petri
  • 4,796
  • 2
  • 22
  • 31
0
votes
0 answers

Pycairo C API linker errors

I am trying to include the pycairo C API in a C application. I include the pycairo header: #include Pycairo.h and this is on my include path. But I get a load of linking errors (LNK2019), along the lines of undefined external reference…
jramm
  • 6,415
  • 4
  • 34
  • 73
0
votes
1 answer

Rare PyCairo antialias getting directly the surface data

After create a Pycairo context and surface (ImageSurface) I get a diferent export results if I get directly from surface buffer surface.get_data() or from PNG export method surface.write_to_png() The context antialias flag is obviously the same…
Htechno
  • 5,901
  • 4
  • 27
  • 37
0
votes
1 answer

white flashes on transparent image edges in cairo

I am trying to display png image with transparency on black background, moving it slowly around on surface, but a lot of frames contain white pixels. (that should not be there at all) The logo surface is created like this: self.logo_surface =…
zidik
  • 136
  • 12
1 2 3
16
17