Closed lucach closed 3 months ago
I am wondering if it is possible to detect what skia's image color type is (such as a class static method), and also adds a few more tests to the pytests.
Oh, we do expose the kN32...
type directly: https://github.com/kyamagu/skia-python/blob/e0b030c14e33f70880cfcc502eaeed898a77fc3c/src/skia/ImageInfo.cpp#L62 so it is possible to test if it is equal to either of the two, to detect endian.
The merge commit failed CI because of the Centos EOL July 2024 issue - that's fixed by the m127/m128 pulls. we can ignore the failure.
The default color type of a
skia.Image
is platform dependent. On some systems (e.g., GitHub CI, and most Linux systems) the default color type is BGR (for endianness purposes).See https://github.com/google/skia/blob/6ffe89f9b4cc8c1dae9c4a916f16f9c463e3fa6d/include/core/SkColorType.h#L58-L62
Thus, in general, not only one has to convert the
alphaType
to create a PIL image, but also thecolorType
.