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
51
votes
10 answers

PPT to PNG with transparent background

I have a PowerPoint .ppt file and I have to create an image for every slide. I'm trying to use the integrated PowerPoint "export as .png". It works but the images have all a opaque background, I need a transparent one. Anyone knows if is it possible…
Riccardo
  • 1,309
  • 1
  • 25
  • 35
49
votes
1 answer

How does tinypng.org compress PNG files?

http://tinypng.org/ is a great service, they optimized my png images by ~67%. How does their service work? How can they minimize size and quality of pictures still remains the same?
good_evening
  • 21,085
  • 65
  • 193
  • 298
48
votes
8 answers

Save inline SVG as JPEG/PNG/SVG

I have an inline SVG in my html, and I need to be able to save this as either a JPEG, PNG or SVG. I have tried a few different methods with converting the SVG to canvas and then converting to JPEG, but I haven't been able to get these working. Here…
Tim Rideyourbike
  • 667
  • 1
  • 6
  • 14
47
votes
4 answers

How to set the image quality while converting a canvas with the "toDataURL" method?

I want to set the quality factor when I encode a canvas element to jpg. var data = myCanvas.toDataURL( "image/jpeg" ); It does not give me a quality option. Is there an alternative library I can use? Related: what is the default quality setting…
jedierikb
  • 12,752
  • 22
  • 95
  • 166
46
votes
11 answers

How do I resize pngs with transparency in PHP?

I'm attempting to resize pngs with transparent backgrounds in PHP and the code samples I've found online don't work for me. Here's the code I'm using, advice will be much appreciated! $this->image =…
Ryan Doherty
  • 38,580
  • 4
  • 56
  • 63
45
votes
9 answers

Converting dot to png in python

I have a dot file generated from my code and want to render it in my output. For this i have seen on the net that the command is something like this on cmd dot -Tpng InputFile.dot -o OutputFile.png for Graphviz But my problem is that I want to use…
user506710
44
votes
6 answers

Is it possible to use transparency in an iPhone app icon?

I created a 57×57 circular icon (without shine) which has transparency outside of the circle for my app. I can successfully install the app on Simulator and iPhone. It works fine, and looks great. However, can I submit an icon with transparency to…
yukon
  • 461
  • 1
  • 4
  • 4
43
votes
5 answers

PNG Transparency with PHP

Hey having some trouble trying to maintain transparency on a png when i create a thumbnail from it, anyone any experience with this? any help would be great, here's what i am currently doing: $fileName=…
BastardPrince
  • 433
  • 1
  • 4
  • 4
41
votes
4 answers

Convert JPG/GIF image to PNG in PHP?

Possible Duplicate of Convert jpg image to gif, png & bmp format using PHP I have a PHP form that allows image uploads and checks exif_imagetype(); to make sure an image is valid. However, I want all formats, PNG, JPG, JPEG, and GIF, to end up…
Aaron
  • 1,956
  • 5
  • 34
  • 56
40
votes
1 answer

How do I convert pngs directly to android vector drawables?

Are there online tools to convert png file to vector drawable files (xml in Android)? I have few pngs that I was using for icons & various places in my app. So, now I want to convert them to xmls. Is it possible to do so?
Swati Garg
  • 995
  • 1
  • 10
  • 21
40
votes
4 answers

Reference images stored in external dll using wpf

I have a wpf application and a class library(dll) project. In my dll I have an images folder with some .png files set as Resource. I want to reference and display the image using the wpf main application. Any ideas? I want to do this in the xaml not…
Matt B
  • 741
  • 3
  • 10
  • 17
40
votes
3 answers

I have a base64 encoded png, how do I write the image to a file in PHP?

What's the proper way in PHP to create an image file (PNG), when I have the base64 encoding? I've been playing around with: file_put_contents('/tmp/'. $_REQUEST['id'].'.png', $_REQUEST['data']); do I need to decode? should I be using the gd…
mmattax
  • 27,172
  • 41
  • 116
  • 149
40
votes
4 answers

How do I make a PNG resource?

I've got a form with a large TImage on it as a background. Problem is, this is stored directly in the DFM as a bitmap, which takes up about 3 MB. The original PNG file is ~250K. I'd like to try to reduce bloat by embedding the PNG in a resource,…
Mason Wheeler
  • 82,511
  • 50
  • 270
  • 477
39
votes
2 answers

Does PNG support metadata fields like Author, Camera Model, etc?

When I click on the image>property>details of a PNG image in Windows many fields are missing compared to a JPEG file. Are these fields supported in PNG? If so, how would they be added in a PNG file programmatically?
techno
  • 6,100
  • 16
  • 86
  • 192
39
votes
7 answers

Convert and resize SVG to PNG

I am trying to convert SVG to PNG (or any raster format) and resize at the same time. I thought I would use ImageMagick for this task but it seems to be converting to raster before resizing. This results in a poor quality image. Is there a way to…
DJL
  • 2,060
  • 3
  • 20
  • 39