I found JPG does not support transparency, the alpha value is always 255. I am wondering only png supports transparency?
-
4There is a bunch of formats supporting transparency, just JPEG isn't one of 'em... – Juicy Scripter Feb 05 '12 at 08:18
-
1http://www.faqs.org/faqs/jpeg-faq/part1/section-12.html – AsTheWormTurns Feb 05 '12 at 08:28
-
TGA targa i think has alpha channel. pic formats and bit depths are amazing complex. rgba argb in all combinations for 16 to 32 bit – bandybabboon Jun 14 '16 at 18:34
4 Answers
png-32
supports different levels of transparency. Each pixel can have an opacity between 0 and 255, with 0 as completely transparent.png-24
supports setting one color as fully transparent. Everything else will be opaque.gif
uses a color palette. You can specify that one color in the palette is fully transparent.png-8
also uses a color palette but each color in the palette has its own opacity value, so it supports varying levels of transparency too.jpg
does not support transparency.

- 6,337
- 6
- 33
- 59

- 1,221
- 10
- 13
-
12This is not correct. Paletted PNG-8 supports varying levels of transparency (see [pngquant](http://pngquant.org)). *Only Photoshop and GIMP don't*, so you need better tools for this (e.g. Fireworks or the aforementioned pngquant). – Kornel Mar 19 '12 at 10:18
-
1
-
3PNG-24 supports only GIF-like transparency (one color is specified to be the transparent color and it is fully transparent). PNG-32 supports different levels of transparency via the alpha channel, in which each pixel can have an opacity between 0 and 255. There may be some applications that erroneously refer to PNG32 files as "PNG-24". – Glenn Randers-Pehrson Jan 17 '16 at 00:26
JPEG 2000 supports full transparency. See JPEG 2000 Side channel spatial information.

- 729
- 1
- 7
- 17
-
8JPEG2000 is a new file format, not an extension of the original JPEG format. – Jongware May 28 '15 at 22:18
-
3Not to be confused with the .JPG file format discussed in the question. JPEG 2000 is .jp2 – gisol May 29 '19 at 09:00
JPEG XR (not the same as JPEG 2000) also supports transparency.
However it is not a useful format for the web as only Internet Explorer and Edge support it.
WebP is another emerging image format with support for transparency.
However, Internet Explorer lacks support for it.

- 19,174
- 12
- 70
- 108
From Transparency (graphic) - Wikipedia:
Raster file formats that support transparency include GIF, PNG, BMP, TIFF, TGA and JPEG 2000, through either a transparent color or an alpha channel.

- 1,969
- 4
- 28
- 58