Results 1 to 5 of 5

Thread: Save Qt tiff files in 1 bit not 32 bit

  1. #1
    Join Date
    May 2009
    Location
    Memphis, TN
    Posts
    22
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Windows

    Default Save Qt tiff files in 1 bit not 32 bit

    Anyone know how to save a black and white tiff file in "2 colors" not "millions of colors"?

    Qt saves them as 32 bit but I only need 1 bit (QImage::Format_Mono)

    Or does Qt have another format that can save black and with images in the smallest size possible?

    Thank you, Jeff.
    Last edited by jeffpogo; 20th June 2009 at 01:43. Reason: updated contents

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,017 Times in 4,793 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Save Qt tiff files in 2 bit not 32 bit

    Mono is one bit (2 colours), not two (4 colours)... Storing one bit images as tiff and expecting them to be small is a dead man's wish. Use PNG instead, it offers a decent compression and is loseless format just like tiff.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. The following user says thank you to wysota for this useful post:

    jeffpogo (20th June 2009)

  4. #3
    Join Date
    May 2009
    Location
    Memphis, TN
    Posts
    22
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Save Qt tiff files in 1 bit not 32 bit

    I wish I could use png but our "old" imaging system only works with tiff files.

    The tiff files on our imaging system are about 1/2 to 1/3 the size of the qt tiff lzw compressed files.

    I might pull the tiff plugin source and create a local 1 bit write function.

    Thank you for the idea.

    Jeff.

  5. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,017 Times in 4,793 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Save Qt tiff files in 1 bit not 32 bit

    If tiff supports a 1bit image format (I don't know if it does, tiff is mostly used for photos, not mono bitmaps) then saving it as such should have worked.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  6. #5
    Join Date
    Jun 2009
    Posts
    9
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Save Qt tiff files in 1 bit not 32 bit

    Tiff is a sort of meta-fileformat, it can support any colorspace, any compression and custumn meta tags. So you could have a scanner that likes outputting images with 1 bit for black-white and 13bits for shades of purple ... all compressed with let's say the rar-algorithm.

    So working with tiff really is no fun. Qt4 works with 32bit ARGB internally and as far as I know cannot be told to work with other stuff. blowing up 1bit image data to 32bit looks like a waste of space. So if you need fast processing of lot's of images, you might be faster with your own implementation.

Similar Threads

  1. visual studio project files - adding extra files
    By luf in forum Qt Programming
    Replies: 3
    Last Post: 13th June 2008, 21:05
  2. Woking with tiff Files
    By nareshqt in forum Qt Programming
    Replies: 4
    Last Post: 9th June 2008, 11:22
  3. how to save sequences of text files and sound files
    By nagpalma in forum Qt Programming
    Replies: 8
    Last Post: 3rd July 2007, 00:06
  4. read files and save the,
    By kernel_panic in forum Qt Programming
    Replies: 2
    Last Post: 4th January 2007, 06:31
  5. What does "Save All" actually save?
    By Mariane in forum Newbie
    Replies: 7
    Last Post: 31st January 2006, 13:23

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
  •  
Qt is a trademark of The Qt Company.