Results 1 to 8 of 8

Thread: Image reading and writing line by line

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Apr 2010
    Location
    Moscow
    Posts
    31
    Qt products
    Qt4
    Platforms
    Windows
    Thanks
    6

    Default Re: Image reading and writing line by line

    Hey, guys. Ain't there any idea?

  2. #2
    Join Date
    Apr 2010
    Posts
    769
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11
    Thanks
    1
    Thanked 94 Times in 86 Posts

    Default Re: Image reading and writing line by line

    Qt doesn't really give you access to the primitive graphics and image file functions you need to do this properly. If your solution works for your purposes, then you're done. But as noted, there are potential problems with it.

    Most modern image formats use some sort of compression. In JPEG, images are processed in 8x8 blocks, so you would need access to the raw JPEG library to read strips, which would decompress into more than a single line. Other formats, like JPEG2000, use wavelet transforms for compression, and the spatial information in the image is scattered throughout the compressed data, making retrieval of individual lines or blocks problematic.

    For similar reasons, your procedure of removing blocks, reducing them and then stitching them back together to produce a single, reduced image may produce "seams" around the edges of your individual tiles, because the compression algorithm relies on a broad "neighborhood" around each pixel and behaves differently near edges. You'll want to inspect your images carefully after reassembly to see if these are visible, or if they are objectionable.

    A better solution would be to use a tool like ImageMagick, an image processing toolkit that can be used from either the command line or through a C++ interface. It allows you to set the maximum amount of memory an operation will consume, and is careful not to exceed that limit, although more memory results in greater execution speed. But when dealing with really huge images, it is often the best solution available. It's scaling algorithms are top-notch, as well, and their advantages and shortcomings are carefully documented. Plus, it's free.

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

    Astrologer (29th April 2010)

  4. #3
    Join Date
    Apr 2010
    Location
    Moscow
    Posts
    31
    Qt products
    Qt4
    Platforms
    Windows
    Thanks
    6

    Default Re: Image reading and writing line by line

    Yes, it seems to be a great library, though I just skimmed over it. I am going to plough on with the library. Thank you all, guys.

Similar Threads

  1. New line when writing a File
    By locke in forum Qt Programming
    Replies: 5
    Last Post: 17th May 2011, 11:27
  2. Replies: 1
    Last Post: 21st November 2009, 08:29
  3. Why doesn't the line appear on my Image?
    By Gh0stR1der in forum Newbie
    Replies: 1
    Last Post: 18th April 2009, 23:42
  4. Replies: 0
    Last Post: 28th February 2009, 23:18
  5. Almost reading QImage line by line, help me please.
    By newqtuser in forum Qt Programming
    Replies: 4
    Last Post: 18th July 2008, 14:22

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.