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
37
votes
5 answers

Drawing PNG to a canvas element -- not showing transparency

I'm trying to use drawImage to draw a semi-transparent PNG on a canvas element. However, it draws the image as completely opaque. When I look at the resource that's being loaded and load the actual PNG in the browser, it shows the transparency, but…
pixielex
  • 779
  • 2
  • 8
  • 13
37
votes
10 answers

How to combine multiple PNGs into one big PNG file?

I have approx. 6000 PNG files (256*256 pixels) and want to combine them into a big PNG holding all of them programmatically. What's the best/fastest way to do that? (The purpose is printing on paper, so using some web-technology is not an option and…
soc
  • 27,983
  • 20
  • 111
  • 215
37
votes
2 answers

Batch process .png to .webp

I have around 100 .png images, and all of them have to be converted to .webp (Google's image format). I am using Google's CLI tool. Any idea how to batch process them.
user2111006
  • 515
  • 1
  • 4
  • 6
36
votes
14 answers

How to solve/hack fading semi-transparent PNG bug in IE8?

As you know, IE6 has bug that can't display semi-transparent PNG file without using non-standard style like filter. In IE7, this problem is fixed. But It still has some bug about PNG file. It can't correctly display fading semi-transparent PNG file.…
user94893
35
votes
2 answers

Recursively batch process files with pngquant

I have a lot of images that I would like to process with pngquant. They are organized in a pretty deep directory structure, so it is very time-consuming to manually cd into every directory and run pngquant -ext .png -force 256 *.png Is there a way…
cmal
  • 1,751
  • 5
  • 18
  • 29
35
votes
6 answers

Detect Alpha Channel with ImageMagick

Scenario I would like to save images with alpha transparency as .png and images without alpha transparency as .jpg (even if their original format is .png or .gif). How can I detect whether or not an image has alpha transparency using ImageMagick?
brad
  • 73,826
  • 21
  • 73
  • 85
35
votes
17 answers

Which format for small website images? GIF or PNG?

When doing small icons, header graphics and the like for websites, is it better to use GIFs or PNGs? Obviously if transparency effects are required, then PNGs are definitely the way to go, and for larger, more photographic images I'd use JPEGs - …
David Heggie
  • 2,868
  • 1
  • 24
  • 21
34
votes
3 answers

How to generate a PNG file with C#?

I'm trying to generate a PNG file using C#. Everything I google seems to be WPF related. My issue is, I need to create a PNG 50x50 square filled with green in .NET 2.0. My question is, how do I do this? I was looking in the System.Drawing namespace.…
Villager
  • 6,569
  • 22
  • 65
  • 87
33
votes
1 answer

Can a PNG image contain multiple pages?

On OSX I converted a multi-page PDF file to PNG and (somehow) it created a multi-page PNG file. Is there an extension to the PNG format that allows this? Or is this not something I can validly create? ~~~~ To clarify, this is a PNG file, per the…
William Entriken
  • 37,208
  • 23
  • 149
  • 195
33
votes
1 answer

How to convert jpg files into png files with linux command? + Difficulty = Subfolders

I want to convert several jpg files into png files. As far as I know, one can use this command mogrify -format png *.* I have one problem, I have a lot of subfolders. Let's say a is my main folder and b,c and d are subfolders. The images are in the…
Merrythought
  • 355
  • 1
  • 3
  • 4
33
votes
6 answers

Python: Read and write TIFF 16 bit , three channel , colour images

Does anyone have a method for importing a 16 bit per channel, 3 channel TIFF image in Python? I have yet to find a method which will preserve the 16 bit depth per channel when dealing with the TIFF format. I am hoping that some helpful soul will…
Lars Chr
  • 947
  • 1
  • 9
  • 12
32
votes
2 answers

Android - Is it possible to declare an alpha mask directly within layer-list XML definition?

A newbie question I have this layers.xml that I use as a source for an ImageView. And two images, mask.png and image.jpg layers.xml:
Shlomi Schwartz
  • 8,693
  • 29
  • 109
  • 186
32
votes
1 answer

Transparent PNG in PIL turns out not to be transparent

I have been hitting my head against the wall for a while with this, so maybe someone out there can help. I'm using PIL to open a PNG with transparent background and some random black scribbles, and trying to put it on top of another PNG (with no…
MarkTraceur
  • 323
  • 1
  • 3
  • 7
32
votes
9 answers

Convert SVG file to multiple different size PNG files

I have a logo image in SVG format and I am wondering if theres a way to generate multiple different sized png files. Eg, I set 20 different width and height and it generates 20 PNG files. It okay if I have to do it 5 images at a time. I have…
Mo Beigi
  • 1,614
  • 4
  • 29
  • 50
32
votes
2 answers

How to draw an inline svg (in DOM) to a canvas?

Well, I need some help about convert .svg file/image to .png file/image... I have a .svg image displayed on my page. It is saved on my server (as a .png file). I need to convert it to a .png file on demand (on click on a button) and save the .png…
Julo0sS
  • 2,096
  • 5
  • 28
  • 52