[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-devel
Subject:    Re: QImage conversion functions
From:       Thomas Gillespie <tomjamesgillespie () googlemail ! com>
Date:       2008-08-26 21:23:26
Message-ID: 200808262223.26962.tomjamesgillespie () googlemail ! com
[Download RAW message or body]

On Tuesday 26 August 2008 20:55:29 David Johnson wrote:
> Here's the code I meant to attach:
>
> #include <QDebug>
> #include <QtGui>
>
> int main()
> {
>     QImage img = QImage("image.png");
>     int newHeight= img.height()*2;
>     int newWidth= img.width()*2;
>     img = img.scaled(newWidth, newHeight, Qt::KeepAspectRatio,
>                      Qt::SmoothTransformation);
>     img = img.convertToFormat(QImage::Format_Mono, Qt::MonoOnly);
>     img.setDotsPerMeterX(150*39); //150 dpi
>     img.setDotsPerMeterY(150*39); //150 dpi
>     qDebug() << img.depth();
>     img.save("output.tif", "tiff", 100);
>     img.save("output.png", "png", 100);
> }

Ok I've done a little bit more investigating with some conversions. Firstly, 
when i converted a png to a tiff using both qt and imagemagick the one 
produced by qt was (get this) 223 times bigger than the one from imagemagick. 
So i found a tiff tag viewer on the internet to see what the difference is  
(If youre interested the imagemagick one is here 
http://img396.imageshack.us/my.php?image=snapshot1rz9.png and the qt one is 
here http://img81.imageshack.us/my.php?image=snapshot2jd2.png). The main 
difference seems to be the bitspersample, which would explain the huge size 
difference, and may be what is confusing tesseract. However the 
convertToFormat doesnt seem to help. I'm well and truly stuck.... :-(

Thanks

Tom
 
>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic