https://bugs.kde.org/show_bug.cgi?id=421289

            Bug ID: 421289
           Summary: Broken Channels management
           Product: krita
           Version: 4.2.9
          Platform: MS Windows
                OS: MS Windows
            Status: REPORTED
          Severity: normal
          Priority: NOR
         Component: Scripting
          Assignee: krita-bugs-n...@kde.org
          Reporter: kapyia....@gmail.com
  Target Milestone: ---

Created attachment 128336
  --> https://bugs.kde.org/attachment.cgi?id=128336&action=edit
Broken Channels script

SUMMARY
I've been running into a couple of issues while experimenting with manipulating
individual channels using the Python API.


First thing I noticed is that the 'channels' function of the Node class returns
a QList with the channels ordered as "BGRA". This could be intentional for all
I know and not a bug, but I thought/assumed them to be ordered as "RGBA".

-

Second problem I ran into was that the 'pixelData' function of a Channel
returns a byte array with a full 4 bytes per pixel, but only the alpha channel
of each pixel holds data. Not too confusing, but it would've been nice if the
documentation was a bit clearer about this :) 

This feeds into the third problem, which is that the 'setPixelData' function
doesn't account for only the alpha channel/byte actually has valuable data.
Writing the pixel data from one channel to another results in only every 4
pixels actually having data, whilst the remaining 3/4 of the pixels are empty.

The second and third problem could probably be solved with one swoop if either
the QBA returned by the 'pixelData' function only had one byte per pixel, or if
the 'setPixelData' only wrote from the alpha channel/byte of the input QBA :)

-

The fourth problem I've run into is that I seem to only be able to get the data
from the Blue channel. No matter which index in the list retrieved using the
'channels' function in the Node class, it's always the Blue channel. This is
evident when writing the pixel data to the alpha channel of a node and
comparing the thumbnails in the Channels docker.

- 

Fifth and final problem I've encountered is that when I tried writing pixel
data from one channel to another it appears the data gets corrupted, resulting
in unwanted artefacts.

I've attached a script to help test these issues :)
SOFTWARE/OS VERSIONS
Windows 10 x64

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to