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
19
votes
4 answers

Golang how to concatenate/append images to one another

Go has great image manipulation and data libraries however I'm having trouble creating one big image from smaller ones. Does anyone know how to take two png or jpeg files in Golang and concatenate them to form one big image that encompasses the two…
efel
  • 1,054
  • 3
  • 14
  • 29
19
votes
6 answers

Convert DOC / DOCX to PNG

I am trying to create a web service that will convert a doc/docx to png format. The problem I seem to have is I can't find any library or something close to it that will do what I need, considering I am looking for something free and not Office…
relysis
  • 1,065
  • 1
  • 14
  • 27
19
votes
2 answers

Does using image sprites make sense in HTTP/2?

The bundling of JS and CSS files won't be necessary in HTTP/2, but what about image sprites? Looking at the demo it seems that it already works way faster than HTTP/1.1, but won't bundling images into sprites make it even faster? I mean, won't the…
Victor Marchuk
  • 13,045
  • 12
  • 43
  • 67
19
votes
1 answer

Android Studio 1.3 SVG to png conversion

In recent google IO 2015, google announced that the new Android Studio 1.3/ new gradle plugin will have support for importing and SVG file and the build system will generate the assets for different device densities (hdpi, xhdpi, xxhdpi etc):…
Nilesh Pawar
  • 3,895
  • 3
  • 21
  • 19
19
votes
7 answers

Crop a PNG image to its minimum size

How to cut off the blank border area of a PNG image and shrink it to its minimum size using Python? NB: The border size is not a fixed value, but may vary per image.
jack
  • 17,261
  • 37
  • 100
  • 125
19
votes
4 answers

Change color of non-transparent parts of png in Java

I am trying to automatically change the color for a set of icons. Every icon has a white filled layer and the other part is transparent. Here is an example: (in this case it's green, just to make it visible) I tried to do the following: private…
4ndro1d
  • 2,926
  • 7
  • 35
  • 65
18
votes
3 answers

Ghostscript Multipage PDF to PNG

I've been using ghostscript to do pdf to image generation of a single page from the pdf. Now I need to be able to pull multiple pages from the pdf and produce a long vertical image. Is there an argument that I'm missing that would allow this? So…
Josh Bush
  • 2,708
  • 4
  • 24
  • 25
18
votes
7 answers

Background colour of a PNG in IE8

I have the following logo, which displays as the same background colour as the HTML body in FF3, Chrome (#363636). But in IE8 it displays a different, darker colour. Is this FF3/Chrome being forgiving of my PNG, or just another IE bug (I thought…
Chris S
  • 64,770
  • 52
  • 221
  • 239
18
votes
4 answers

How to convert SVG to PNG or JPEG in Python?

I'm using svgwrite and generating svg-files, how do I convert them to PNG or JPEG?
hkm
  • 342
  • 1
  • 2
  • 10
18
votes
5 answers

Alpha transparency in indexed-png images

Here is an image: This image is a simple black-to-transparent gradient saved in full RGBA PNG. Here is the same image, converted to indexed-alpha PNG by GIMP (Photoshop produces the same result) As you can see, the gradient is now half-opaque,…
Niet the Dark Absol
  • 320,036
  • 81
  • 464
  • 592
18
votes
4 answers

how to compress a PNG image using Java

Hi I would like to know if there is any way in Java to reduce the size of an image (use any kind of compression) that was loaded as a BufferedImage and is going to be saved as an PNG. Maybe some sort of png imagewriteparam? I didnt find anything…
ubernoob
  • 181
  • 1
  • 1
  • 5
18
votes
1 answer

An Image Compression tool for windows similar to ImageOptim (of mac)

I was looking for a image compression tool for windows(Windows 7, more specifically), similar to ImageOptim (of mac). I've used few jpeg compressors tools in windows but they aren't giving the desired result. Yes, they compress the size but the…
JayKandari
  • 1,228
  • 4
  • 16
  • 33
17
votes
4 answers

Saving a Java 2d graphics image as .png file

I am drawing a graphical representation of information my simulation is generating. I have the graph displaying but the problem i am running into is to be able to save it as a .png. When it saves the png, the file is all black, so it's not saving…
theoreticalyield
  • 171
  • 1
  • 1
  • 4
17
votes
3 answers

Render SVG to PNG on the server with pure JavaScript

The title says it. I know Imagemagick can do that, but let us assume I am on a cloud server that will only allow me JavaScript (coughnodestercough). Which is not a bad thing, actually. Recently I heard that there are h.264 renderers in javascript,…
Lanbo
  • 15,118
  • 16
  • 70
  • 147
17
votes
4 answers

Managed PNG Optimization Library Available?

I am looking to build in PNG optimization (a PNG "sqeezer/squisher" of sorts) into my builds (TFS 2010 Build Workflow). I want to create a new build activity and as with all my activities, I prefer to have all my code managed with little to no…
Issa Fram
  • 2,556
  • 7
  • 33
  • 63