Questions tagged [pypng]

Pure Python library for PNG image encoding/decoding

Definition:

PyPNG provides Python code for encoding and decoding PNG files.

Example Usage:

import png
f = open('example.png', 'wb')
w = png.Writer(255, 1, greyscale=True)
w.write(f, [range(256)])
f.close()

Important Links:

35 questions
0
votes
1 answer

Where is the stream being closing? using PyQRCode to create a png QR with io stream

I'm using PyQRCode [0] to generate a QR in PNG format under Python 2.7.6. When I try to write a file on disk using all works ok: import pyqrcode from io import BytesIO qr = pyqrcode.create("my qr string", mode='binary',…
edepe
  • 381
  • 3
  • 12
0
votes
2 answers

Python base64 string to PyPng without saving file

How do you do this without saving to disk and then opening 'out.png' ? r = requests.get(url) mine,encoded = r.json()[0]['data'].split(',') #if it is segmentation decoded = base64.decodestring(encoded) if mine ==…
-1
votes
1 answer

PyPng is giving me a very strange error, what can i do?

I'm using PyPng to draw Png-Files. I'm new to it (new as in 20 minues) and I use the following Code to generate a 6 by 6 pixel image, but it doesn't work. I've tried the same code (maybe or maybe not copied from the internet) on a 3 by 6 image and…
Mr. MAD
  • 1
  • 4
-1
votes
1 answer

How can I increase the pixel size in PNG file in Python?

Suppose I had a PNG image like this: https://www.box.com/s/dc4dut3yw1vhagm4y9ks And I want to increase the red dots size which means, they have to fill their square neighbors too. Like below: www -> rrr wrw -> rrr www -> rrr
Amir
  • 1,087
  • 1
  • 9
  • 26
-1
votes
1 answer

PyPNG read 48-bit, change pixel color, write pixel back

I was wondering if someone could post an example using PyPNG to read a 48-bit image (16 bit channel R,G, and B), get and display a specific pixel color (say pixel 88 or whatever), change that value, and write it back into the png. I found the…
wren
  • 3
  • 3
1 2
3