Hi Gunnar,

Thanks for the quick reply.

>This code makes little sense... First you create the pixmap 
>with ARGB32 format, then convert it to ARGB32 format? This is 
>a redundant operation and should be removed.

Yes you are correct :-))

>Using a painter for this is overkill and in addition to being 
>a lot more expensive... why not just:
>                   img1.setPixmap(i, j, qcol.argb());

That was the first thing I tried, but there was dither. So then tried
with Qpainter.
My original code was:
        for (int i = 0; i < w(); i++) {
            for (int j = 0; j < h(); j++) {
                int col = img.pixel(i, j);
                if (col == 0) {
                    continue;
                }
                QColor qcol = new QColor(col);
                qcol.setHsvF(0.0, 1.0, 0.0, 1.0);
                img.setPixel(i, j, qcol.rgba());
            }
        }
        return img;

>The reason you have artifacts along the edges of your image is 
>because you are drawing with anti-aliasing. A complete 
>description of the coordinates system is covered here:
>http://doc.trolltech.com/qtjambi-4.4/html/com/trolltech/qt/coor
>dsys.html
>
>but you probably just want to use QImage::setPixel().

I had gone through this, and have tried almost all possible combinations
of render hints and pen/brush styles with a painter, but come across the
same problem. I am stuck. I can increase the pen width and this dither
goes away, but the image no longer resembles the original in terms of
size/sharpness.
Or should I write some algorithm to blur only the edges and thus hide
this dither. But that would make the whole thing even more heavy. Any
ideas ?

BR
Chetan

_______________________________________________
Qt-jambi-interest mailing list
[email protected]
http://lists.trolltech.com/mailman/listinfo/qt-jambi-interest

Reply via email to