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
71
votes
6 answers

What is difference between png8 and png24

I want to know about uses of png files. There are two formats available for png images; one is png8 and the another one is png24. I would like to know that if I use either type in my html page, will there be any error? Or is this only quality…
Kesar Sisodiya
  • 1,564
  • 2
  • 15
  • 25
68
votes
6 answers

webdesign - jpg or png, which one is the best for web

I've been a web developer for quite some time, and I am used to transforming all my designs into the png file format in order to build my webpages. Despite the fact that png, contrary to jpg, allows transparency in the images, is it a better…
yoda
  • 10,834
  • 19
  • 64
  • 92
67
votes
2 answers

ImageMagick extend canvas with transparent background

convert input.png -extent 100x100 -gravity center -background white output.png If the input is 50x50 the surrounding background is white. Can I somehow set this to transparent without declaring any color within input as transparent?
Toby
  • 2,720
  • 5
  • 29
  • 46
66
votes
4 answers

Only PNG supports transparency, is that true?

I found JPG does not support transparency, the alpha value is always 255. I am wondering only png supports transparency?
Adam Lee
  • 24,710
  • 51
  • 156
  • 236
66
votes
5 answers

Free tool to Create/Edit PNG Images?

Is there any free tool available for creating and editing PNG Images?
Ramesh Soni
  • 15,867
  • 28
  • 93
  • 113
63
votes
3 answers

Converting a byte array to PNG/JPG

I am currently working on an application that requires high-performance conversion of an unpadded byte array to either a PNG or JPEG. The image format doesn't matter, just as long as it's fast. I have tried the .NET libraries and the performance is…
user472875
  • 3,115
  • 4
  • 37
  • 68
63
votes
2 answers

Why should I use PNG and not JPG?

I'm building an app that uses a lot of images, so it's getting pretty big. I got more than 15mb in PNG images, and if I convert those images to JPG I would get 5MB or less! So, why should I use PNG instead of JPG? I know that PNGs are preferred, but…
Victor Santiago
  • 902
  • 1
  • 10
  • 20
63
votes
8 answers

Use PHP to convert PNG to JPG with compression?

I have a bunch of high quality PNG files. I want to use PHP to convert them to JPG because of it's smaller file sizes while maintaining quality. I want to display the JPG files on the web. Does PHP have functions/libraries to do this? Is the…
John
  • 32,403
  • 80
  • 251
  • 422
62
votes
5 answers

Darkening an image with CSS (In any shape)

So I have seen quite a few ways to darken images with CSS, including ones with rounded corners, but my problem is different. Let's say I have an .png image that looks like a little dog (just go with it, I don't have any good examples), when I place…
Josiah
  • 4,663
  • 2
  • 31
  • 49
57
votes
7 answers

PIL: Thumbnail and end up with a square image

Calling image = Image.open(data) image.thumbnail((36,36), Image.NEAREST) will maintain the aspect ratio. But I need to end up displaying the image like this: Can I have a letterbox…
Paul Tarjan
  • 48,968
  • 59
  • 172
  • 213
56
votes
5 answers

Chrome downloads PNG image links. I want them to open for viewing in a new tab. How do I make Chrome do that?

When I click on an image link right now, Chrome downloads the image instead of opening it. Even if I right-click and select Open link in new tab Chrome still downloads the image, and I have to go through the extra steps of opening the file for…
Robusto
  • 31,447
  • 8
  • 56
  • 77
55
votes
3 answers

How can I create an empty n*m PNG file in Python?

I would like to combine 4 PNG images to one PNG file. I know who to combine them with Image.paste method, but I couldn't create an save output file! Actually, I want to have a n*m empty PNG file, and use to combine my images. I need to specify the…
Amir
  • 1,087
  • 1
  • 9
  • 26
54
votes
5 answers

ImageMagick: Lossless max compression for PNG?

I'd like to achieve a maximum amount of compression when saving to a lossless PNG using ImageMagick. I'm doing batch conversion of many PSDs. I tried a few things, but it looks to me like the resulting PNG image is not as sharp as original image,…
Mladen Adamovic
  • 3,071
  • 2
  • 29
  • 44
54
votes
8 answers

Matplotlib Plots Lose Transparency When Saving as .ps/.eps

I'm having an issue with attempting to save some plots with transparent ellipsoids on them if I attempt to save them with .ps/.eps extensions. Here's the plot saved as a .png: If I choose to save it as a .ps/.eps here is what it looks like: How I…
astromax
  • 6,001
  • 10
  • 36
  • 47
54
votes
6 answers

CSS Border on PNG image with transparent parts

Im trying to add a border on a PNG image I have (Example included). The thing is that when I add the border currently it adds it on a box shape around all the image and not on the exact vector (Meaning it includes the transparent parts in the…
nimi
  • 917
  • 2
  • 14
  • 28