Canvas.requestPaint() renders Image data tinted blue

HARDWARE: vollaphone/gigaset gs290, XA2, Xperia 10 ii


Give an Image and a Canvas, calling something like drawingCanvas.requestPaint() causes the Image to be rendered in the Canvas with a blue tint. An example in @kimmolindholm s paint (which I’m trying to resurrect):

Possibly related to:


Application context:



  1. call canvas.requestPaint() with a Image object on the page.


The image should retain it’s hues. Same source deployed to 3.4 works fine.


The image is tinted.


Good question, but I’ve tested on a clean install device. No difference.


Copying the data from the Image (insertedImage is an Image {} tag) ‘sometimes’ works.

        insertedImage.grabToImage(function(result, rotation)
            var url = result.url
            var ctx = drawingCanvas.getContext('2d')
            ctx.drawImage(url, 0, 0)

I would use this work-a-round BUT, ctx.rotate(rotation) does not work.

I’ve now tried this on Vollas(GS290 also) and on an Experia 10 ii.

1 Like

Same issue?

I mentioned that above, but that ticket is about ‘richtext’ in ‘Label’. This is in Canvas. I think it’s related, but haven’t figured out how.

tbh, if my suspicion is correct [that this has nothing to do with Qt and everything to do with the HAL], then both issues will be the same.

1 Like

Ah, I was thinking it had something to do with QT, but HAL, > 3.4 could be the culprit. However, I believe, the tint in html image in richtext Labels was also present in 3.4. The issue with paint was/is not. I’m uncertain since there are some issues on the Vollaphone, so I’d appreciate if people tested the build of ‘Paint’ that I’ve made available on chum and open repos.

In 3.4 (on Volla) the images in Labels (richtext) are rendered tinted. But the images loadaed and drawn to a canvas are not tinted.

@attah just confirmed that the compositing issue reported here does not appear on official sony devices. If anyone with other ports could try the paint app at Paint | — Community Repository System (also on chum) to share if importing image and compositing leads to a tint, that would be really helpful.

Tryed on XA2 4.4 licenced.
Issue also present.


Import in paint:

Thanks! So it looks like it’s more general a problem.

Seems like “negatived”.
Blue → Orange
Orange → Blue

Not exactly. Inverted / negative would be more dramatic :wink: If you take the blue highway and run the RGB-BRG swap it’s almost normal. @attah had showed QML Label dispays images with a blue-ish tint - #13 by attah a method for get back swapping Red and Green, I believe. I’ll implement a filter in paint!

1 Like

So some part of Qt is reading rgb data as grb?

It could be ‘lower’ level, but I’m still poking. @attah had some ideas as well …

Ok, I’ve implemented all the channel swaps and it is not that. It’s a swap, apply bgra (blue green red alpha) and the image is back to normal.

void main(void)
    if (texture2D(mask, > 0.5)
        gl_FragColor = texture2D(source, * qt_Opacity;
        gl_FragColor = texture2D(source, * qt_Opacity;

Does the trick.

1 Like

Actually you’re more or less right :wink: blue swapped with red. close enough :slight_smile:

1 Like

On a tip from @attah I implemented a format conversion which works for me. I’d appreciate feedback. Is this a fix for an original ‘error’ in implementation?

@attah 's concise version:

works. solved. but why!

1 Like

If I was to guess what’s happening, since the QML Canvas.loadImage has neither the correct Orientation from meta, nor the correct order of color channels, it looks like Autotransform/Autocolor are not being used? I haven’t been able to find the code, but on simplifying my above fix, I did a dead simple test.

I removed all nemo meta orientation code and did:

QImageReader ir(filename);

Compiled for 3.4, this ImageProvider gives canvas the correct RGB order AND the correct orientation. So QImage magic does work.

On 4.4, the ImageProvider winds up with the correct orientation but not Color.

So, it looks like a regression.Does not answer the question of what’s happening with html images loaded as richttext in labels though.

1 Like

Given the following:

class ImageProvider : public QQuickImageProvider
    QImage requestImage(const QString &id, QSize *size, const QSize &requestedSize)

        QString filename = QUrl(id).toString(QUrl::RemoveScheme);
        QImage img;
        QSize originalSize;
        QByteArray format;
        QImageReader ir(filename);


        if (!ir.canRead())
            return img;

        originalSize = ir.size();
        format = ir.format();

        if (size)
            *size = originalSize;

        img =;

        if (requestedSize.isValid())
            return img.scaled(requestedSize.width(), requestedSize.height(), Qt::KeepAspectRatio);
            return img;

passed to canvas with: “image://paintImage/” …

in Volla/GS290 number one.
this yields correct orientation and color

in Volla/GS290 number two, and Xperia 10ii
orientation is correct, color is Red swapped with Blue.

As reported in Todays Community meeting, the Color issue is fixed:


I wonder, if there’s some confusion in RGBA vs ARGB in some components of Qt/Lipsick/Silica, would that maybe also explain the high CPU usage for “rgba” elements found and documented by @leszek?
Or rather, are these copy operations particularly expensive?