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

Converting TIFF files to PNG in .Net

I have to build an application in .Net (3.5) to pick up a TIFF file saved from another piece of software and convert it into a PNG so that it can be rendered easily in Internet Explorer. Does anyone know of any libraries (preferably freeware/open…
colethecoder
  • 1,139
  • 2
  • 8
  • 26
21
votes
2 answers

how to read.jpeg in R 2.15

It seems very trivial but I can't read in jpeg, or any type of image into R 2.15. In R 2.10 I could do it using rimage library or ReadImage library - with read.jpeg for example - but there seems to be no way to do it in R 2.15 and later versions.…
HoofarLotusX
  • 562
  • 2
  • 5
  • 11
21
votes
3 answers

How to merge transparent PNG with image using PHP?

The situation is this: I have a small 50x50 pic. I also have a small 50x50 transparent picture which contains a frame for the 50x50 pic, so I basically want to put the transparent png on top of the image and merge those two which would lead to a…
subZero
  • 5,056
  • 6
  • 31
  • 51
20
votes
5 answers

Creating a PNG file in Python

I have an application where I would like to be able to generate PNG images from data in Python. I've done some searching and found "PIL" which looked pretty outdated. Is there some other library that would be better for this?
adam
  • 343
  • 1
  • 2
  • 7
20
votes
4 answers

VS Code - Drag image from Explorer pane into markdown file and drop as path

In Visual Studio Code, from the Explorer pane, how can I drag a PNG file from my images folder and drop it in place in a markdown file, so that VS Code inserts the path to the dropped image? Currently, VS Code just opens the image in a new tab. I've…
Chris Blocher
  • 301
  • 2
  • 5
20
votes
4 answers

How to get around IE8 32k limit on data:uri on base64 encode?

I need to send an html response to the browser containing a 1920x1080 png. It's a screenshot taken by an html query. I encode the image in base64 and sends it embedded as an text/html content-type. Something simple like…
Martin
  • 3,960
  • 7
  • 43
  • 43
20
votes
1 answer

Downloading png from Shiny (R)

I am pretty new to Shiny (and R) and struggling with exporting the plot I make in Shiny to a png-file. I looked at these two threads but could not figure it out: Save plots made in a shiny app Shiny downloadHandler doesn't save PNG files I manage…
sba
  • 237
  • 1
  • 2
  • 8
20
votes
3 answers

Detecting if a PNG image file is a Transparent image?

I am looking for a way to quickly determine if a PNG image has transparent features. That is, whether any portion of the image is translucent or displays the background in any way. Does anyone one know a simple way to detect this? UPDATE: OK, is…
kenny
  • 21,522
  • 8
  • 49
  • 87
20
votes
8 answers

Efficient way to fingerprint an image (jpg, png, etc)?

Is there an efficient way to get a fingerprint of an image for duplicate detection? That is, given an image file, say a jpg or png, I'd like to be able to quickly calculate a value that identifies the image content and is fairly resilient to other…
Parand
  • 102,950
  • 48
  • 151
  • 186
19
votes
5 answers

PHP wrong result for imagetruecolortopalette with PNG with transparency

I'm trying to write a PHP script that resizes a PNG image and then converts it to PNG-8 bit mode. So the size of the resulting file will be smaller but without too much quality loss. The resize works perfectly, preserving also image…
user2342558
  • 5,567
  • 5
  • 33
  • 54
19
votes
2 answers

Am I creating lossless PNG images?

I am doing image processing in a scientific context. Whenever I need to save an image to the hard drive, I want to be able to reopen it at a later time and get exactly the data that I had before saving it. I exclusively use the PNG format, having…
smcs
  • 1,772
  • 3
  • 18
  • 48
19
votes
5 answers

Can I programmatically determine if a PNG is animated?

I have PNG (as well as JPEG) images uploaded to my site. They should be static (i.e. one frame). There is such thing as APNG. (it will be animated in Firefox). According to the Wikipedia article... APNG hides the subsequent frames in PNG ancillary…
alex
  • 479,566
  • 201
  • 878
  • 984
19
votes
4 answers

"Error in plot.new() : figure margins too large"

In R, I met a running error as follows: > png("p3_sa_para.png", 4, 2) > par(mfrow=c(1,2)) > plot(c(1:10), ylab="Beta",xlab="Iteration") Error in plot.new() : figure margins too large > plot(c(1:10), ylab="Gamma",xlab="Iteration") Error in plot.new()…
Tim
  • 1
  • 141
  • 372
  • 590
19
votes
1 answer

How to save a canvas as PNG in Selenium?

I am trying to save a canvas element as a png image. This is my code right now but, unfortunately, it does not work: import time from selenium import webdriver # From PIL import Imag. driver =…
Clone
  • 3,378
  • 11
  • 25
  • 41
19
votes
8 answers

Convert bitmap to PNG in-memory in C++ (win32)

Can I convert a bitmap to PNG in memory (i.e. without writing to a file) using only the Platform SDK? (i.e. no libpng, etc.). I also want to be able to define a transparent color (not alpha channel) for this image. The GdiPlus solution seems to be…
Assaf Lavie
  • 73,079
  • 34
  • 148
  • 203