Results 1 to 3 of 3

Thread: Converting a JPG to PNG. Why this behaviour?

  1. #1
    Join Date
    Sep 2013
    Posts
    33
    Thanks
    5
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows Android

    Post Converting a JPG to PNG. Why this behaviour?

    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?

  2. #2
    Join Date
    Feb 2012
    Location
    Armenia/Yerevan
    Posts
    400
    Thanks
    15
    Thanked 16 Times in 15 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11

    Default Re: Converting a JPG to PNG. Why this behaviour?

    when you save an image as JPEG, QT calls libjpeg library which in turns encodes the image and adds the JPEG header to it.

  3. #3
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Converting a JPG to PNG. Why this behaviour?

    Quote Originally Posted by blue_sky View Post
    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,
    _

Similar Threads

  1. Converting GUI to CONSOLE
    By timmu in forum Qt Programming
    Replies: 3
    Last Post: 5th December 2011, 08:24
  2. Converting UIC 2 .h & .Cpp
    By jibolso in forum Newbie
    Replies: 5
    Last Post: 5th September 2009, 13:28
  3. Converting C++ to Qt4
    By ComaWhite in forum Qt Programming
    Replies: 8
    Last Post: 11th July 2008, 08:33
  4. Converting QT 4 to VC++
    By vvbkumar in forum Qt Programming
    Replies: 3
    Last Post: 22nd June 2006, 13:54
  5. Converting my UI to Qt4
    By Honestmath in forum Qt Programming
    Replies: 1
    Last Post: 14th April 2006, 23:58

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.