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
25
votes
2 answers

write png quickly

Summary I want to write a .png file as quickly as possible, without a concern for compression. That is, I don't care much about the file size, but I do care that the write happens as quickly as possible. Motivation I am making a web-based map…
M Katz
  • 5,098
  • 3
  • 44
  • 66
25
votes
3 answers

Headers for PNG image output to make sure it gets cached at browser?

I have images (PNG) that are generated dynamically and will be embedded in websites and forums. When an image gets posted on a very busy page, there are a lot many connections to service for something that doesn't change often. I want to tell the…
ddinchev
  • 33,683
  • 28
  • 88
  • 133
25
votes
2 answers

Export plot in .png with transparent background

I am trying to export a simple plot in .png with transparent background. I am able to export it, but the background stays white. Mock example x = c(1, 2, 3) I've tried this plot (x) dev.copy (png,'myplot.png', bg = 'transparent') dev.off() And…
francoiskroll
  • 1,026
  • 3
  • 13
  • 24
25
votes
5 answers

Do PNGs (or JPGs) have a DPI? Or is it irrelevant when building for retina?

A simple question that I have been having great difficulty finding a definitive answer to: do PNG files have a DPI? Or perhaps more importantly, is it even relevant when building retina-enabled sites/apps? I've just received PSD assets from our…
gbanks
  • 433
  • 1
  • 5
  • 14
25
votes
4 answers

Memory corruption in System.Move due to changed 8087CW mode (png + stretchblt)

I have strange a memory corruption problem. After many hours debugging and trying I think I found something. For example: I do a simple string assignment: sTest := 'SET LOCK_TIMEOUT '; However, the result sometimes becomes: sTest = 'SET…
André
  • 8,920
  • 1
  • 24
  • 24
25
votes
2 answers

PNG file format endianness?

Im not sure if endian is the right word but.. I have been parsing through a PNG file and I have noticed that all of the integer values are in big endian. Is this true? For example, the width and height are stored in the PNG file as 32bit unsigned…
Marlon
  • 19,924
  • 12
  • 70
  • 101
25
votes
2 answers

How was this HTML5 screencast animation created?

I visited http://www.sublimetext.com today and was intrigued by the screencast animation the website has on its opening page. It looks like a mashup between video and slideshow. I've seen them at other modern websites as well, but I assumed it was…
Jayesh
  • 51,787
  • 22
  • 76
  • 99
24
votes
12 answers

IE6 PNG transparency

How can I fix PNG transparency bug in IE6 for background image?
Jakub Arnold
  • 85,596
  • 89
  • 230
  • 327
24
votes
7 answers

How do I get an Icon from a png image?

I'm creating an WPF app, so I'm mostly working with the ImageSource class for icons. However, the system tray icon has to be of type System.Drawing.Icon. Is it possible to create such an object from a png image? I have tried the following: private…
Morten Christiansen
  • 19,002
  • 22
  • 69
  • 94
24
votes
3 answers

How to embed images in a single HTML / PHP file?

I am creating a lightweight, single-file database administration tool and I would like to bundle some small icons with it. What is the best way to embed images in a HTML/PHP file? I know a method using PHP where I would call the same file with a GET…
Tatu Ulmanen
  • 123,288
  • 34
  • 187
  • 185
24
votes
3 answers

Reading a PNG image in Node.js

Is there an easy way in Node.js to read a PNG file and get the pixels of the image? Something like node-image, but the other way :) I went through the libraries listed at https://github.com/joyent/node/wiki/modules#wiki-graphics, but they are either…
Jan Špaček
  • 1,111
  • 1
  • 9
  • 24
23
votes
4 answers

Render Highcharts canvas as a PNG on the page

I'm using the HighCharts library to generate some dynamic charts. However, I'd like to render the HighCharts canvas element as a PNG image, such that the user can copy and paste the chart into an email, etc. without having to use the exporting…
Ben Wilson
  • 2,271
  • 3
  • 26
  • 35
23
votes
3 answers

smush.it vs OptiPNG / pngcrush

I'd like to see some online vs. offline image optimizers comparison numbers, namely Yahoo! Smush.it vs. OptiPNG or pngcrush. How those things differ in speed and resulting image size, and what is the best choice?
idle sign
  • 1,164
  • 1
  • 12
  • 19
23
votes
3 answers

Converting svg to png with inkscape command line failing

I feel like I must be doing something silly wrong, but I just can't get this to work. This is the command I am running from cmd: inkscape.com "C:\path\ship.svg" -e --export-png="C:\Path\ship.png" --without-gui In return, I get: WARNING: File path…
eddie_cat
  • 2,527
  • 4
  • 25
  • 43
23
votes
4 answers

Convert PNG to SVG using python

Is there way to convert a png file into SVG file using only pure python or a python module such as wand? To be more precise, I want to convert a png into a real vector graphics, I don't want to embed a bitmap inside the svg, I want to convert into…
marco
  • 915
  • 4
  • 17
  • 35