PDA

View Full Version : Converting a JPG to PNG. Why this behaviour?



blue_sky
25th November 2013, 09:22
When renaming a png to jpg by just clicking rename, the png extension changed to jpg. But the bit depth remains 32bits and all properties of PNG present in the new JPG.
But when I tried to load the png image through QImage object and then saved as .jpg, I found the file is having bit rate 24 bits. Why so?

Who is responsible for understanding difference between JPG/PNG format.The OS/QT Framework. Please help.Is there any standardisation for image formats and extension and bit depth?

saman_artorious
25th November 2013, 09:39
when you save an image as JPEG, QT calls libjpeg library which in turns encodes the image and adds the JPEG header to it.

anda_skoa
25th November 2013, 18:18
When renaming a png to jpg by just clicking rename, the png extension changed to jpg. But the bit depth remains 32bits and all properties of PNG present in the new JPG.

Actually no. What you get is the same PNG file with a different name, not a JPG file with the same image content.

Cheers,
_