Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

jpg bits per pixel

Tags:

image

jpeg

How many bits per pixel in a jpeg. I have a jpg which is 425 x 282 and its size is 20635 bytes. If i encode it to a png its 116255 bytes.

like image 732
user346443 Avatar asked Nov 29 '10 15:11

user346443


People also ask

How many bits are JPG?

Well, a JPEG is an 8-bit image, which means that it uses 8 bits per color channel.

How many bits is a pixel PNG?

As with RGB and gray+alpha, PNG supports 8 and 16 bits per sample for RGBA or 32 and 64 bits per pixel, respectively. Pixels are always stored in RGBA order, and the alpha channel is not premultiplied.

How many bits is 256 pixels?

8-bit color graphics are a method of storing image information in a computer's memory or in an image file, so that each pixel is represented by 8 bits (1 byte). The maximum number of colors that can be displayed at any one time is 256 or 28.

How do I know how many bits an image is per pixel?

Step 1: Multiply the detectors number of horizontal pixels by the number of vertical pixels to get the total number of pixels of the detector. Step 2: Multiply total number of pixels by the bit depth of the detector (16 bit, 14 bit etc.) to get the total number of bits of data.


1 Answers

General answer:

Bits per pixel = Bits/Pixel, 1 Byte = 8 Bits

=> JPG (20635 * 8 bits) / (425 * 282 pixels) => 1,38 bits per pixel

=> PNG (116255 * 8 bits) / (425 * 282 pixels) => 7,76 bits per pixel

But note you're comparing apples to oranges here. PNG is a lossless format, while JPG loses quality depending on the compression strength. The bits per pixel value will vary for different images and different quality/compression settings for both formats.

Also, don't mix this with the term "bits per pixel" that is used for the color depth of an image which should be 24 bits per pixel (8 bits for each red, green and blue) in both cases, although PNG supports 8 bits per pixel using a color palette, too (or even 32 bits per pixel using an alpha channel).

like image 200
schnaader Avatar answered Oct 27 '22 07:10

schnaader