Questions tagged [png]

PNG (Portable Network Graphics) is an image file format designed to store raster graphics. It is associated with ".png" file extension. Use this tag for questions involving this specific format.

PNG was created to improve upon and replace (Graphics Interchange Format) as a losslessly compressed image file format not requiring a patent license.

PNG supports palette-based images with transparency, true colour images with or without alpha channel (RGB, RGBA), and grayscale images; PNG supports channel depths from 1-bit to 16-bit per channel. Interlacing, which allows the progressive display of partially downloaded images, is implemented via the Adam7 algorithm. Animation is supported by way of the extension.

More information

6735 questions
16
votes
8 answers

How to check if a PNG image has transparency using GD?

How do I check if a PNG image has transparent pixels using PHP's GD extension?
HappyDeveloper
  • 12,480
  • 22
  • 82
  • 117
16
votes
3 answers

Python: Converting GIF frames to PNG

I'm very new to python, trying to use it to split the frames of a GIF into PNG images. # Using this GIF: http://www.videogamesprites.net/FinalFantasy1/Party/Before/Fighter-Front.gif from PIL import Image im =…
Joseph
  • 12,678
  • 19
  • 76
  • 115
16
votes
4 answers

Save UIView to a transparent PNG

I have a UIView and I want it to be stored as a transparent PNG, i.e. without the UIVIew background color... I am currently using this code and it's working OK but with the background color :(…
user416445
16
votes
2 answers

File format limits in pixel size for png images?

Is there a file format limit to the PNG pixel size? I am trying to visualize a 30.000x30.000 pixels PNG image with Firefox, but I get an error. The image opens correcly in Preview.app, although very slowly. The file size is not big, just around 3…
Stefano Borini
  • 138,652
  • 96
  • 297
  • 431
16
votes
1 answer

How do I make Tkinter support PNG transparency?

I put in a partially transparent PNG image in Tkinter and all I get is this How do I make the dark triangle on the right clear? (like it's supposed to be) This is python 2.6 on Windows 7, btw.
rectangletangle
  • 50,393
  • 94
  • 205
  • 275
16
votes
8 answers

Change html canvas black background to white background when creating jpg image from png image

I have a canvas which is loaded with a png image. I get its jpg base64 string by .toDataURL() method like this: $('#base64str').val(canvas.toDataURL("image/jpeg")); But the transparent parts of the png image are shown black in the new jpg…
Payam Sh
  • 581
  • 4
  • 9
  • 21
16
votes
7 answers

How to download Google Slides as images?

I am a big fan of using Google Slides as a cloud-hosted lightweight illustrator replacement (that also happens to be collaborative and free!). I wrote up a few thoughts on my process…
tomcritchlow
  • 785
  • 2
  • 11
  • 28
16
votes
3 answers

How can I manually read PNG files in C++?

Portable Network Graphics Overview The general layout of any given PNG file looks like this: File Header: An 8-byte signature. Chunks: Chunks of data ranging from image properties to the actual image itself. The Problem I want to read PNG files in…
user3745189
  • 521
  • 1
  • 7
  • 17
16
votes
3 answers

In PHP, imagepng() accepts a filter parameter. How do these filters affect the function's output?

How do these filters affect the output of imagepng() in PHP? PNG_NO_FILTER PNG_FILTER_NONE PNG_FILTER_SUB PNG_FILTER_UP PNG_FILTER_AVG PNG_FILTER_PAETH PNG_ALL_FILTERS The documentation simply says, "A special PNG filter, used by the imagepng()…
Joe Lencioni
  • 10,231
  • 18
  • 55
  • 66
16
votes
6 answers

Why '.png' files produced by ImageMagick are so much bigger than '.jpg' & '.gif' files?

I'm using ImageMagick to convert some files from one format to another. I was always under the impression that .png files were supposed to be as big/small as .jpg if not smaller, and definitely smaller than .gif. However when I run convert photo.jpg…
konung
  • 6,908
  • 6
  • 54
  • 79
16
votes
4 answers

Get a PDF/PNG as output from a UIWebView or UIView

Is there any way to get the content of a UIWebView and convert it to a PDF or PNG file? I'd like to get similar output to that available on the Mac by selecting the PDF button when printing from Safari, for example. I'm assuming this isn't…
mjdth
  • 6,536
  • 6
  • 37
  • 44
16
votes
1 answer

How to convert bitmap to PNG and then to base64 in Android?

As the title implies, I'm trying to get the user of my Android app to select an image from his device (done), I then want to scale the image down (done), compress/convert the image to png and send it to an API as a base64 string. So I currently…
kramer65
  • 50,427
  • 120
  • 308
  • 488
16
votes
4 answers

How can I skip compressing one PNG?

(Note: I have solved this problem, but it took long enough that I'm posting question/answer here.) The Xcode build process "optimizes" my PNGs when building. This isn't usually a problem, but iTunesArtwork being processed in this way causes corrupts…
Steven Fisher
  • 44,462
  • 20
  • 138
  • 192
16
votes
2 answers

Git won't revert or commit a file that it thinks is modified

I've converted an SVN repository to Git by following this tutorial. And now cannot seem to extract a sub-repository like suggested in this answer. Forgive the long post but most of the text is the nicely formatted git output. OS: Windows 8 Command…
nonsensickle
  • 4,438
  • 2
  • 34
  • 61
16
votes
3 answers

How do I overlay an image on to a ggplot?

I'd like to read an image from the web. e.g. http://api.altmetric.com/donut/502878_64x64.png and insert it into the top right of a ggplot df <- data.frame(x=1:10, y=sample(1:100,10)) # a fake plot to try it on. ggplot(df, aes(x,y)) + geom_point(size…
Maiasaura
  • 32,226
  • 27
  • 104
  • 108