skia-python icon indicating copy to clipboard operation
skia-python copied to clipboard

Improve "convert to PIL" example

Open lucach opened this issue 8 months ago • 2 comments

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 the colorType.

lucach avatar Jun 01 '24 11:06 lucach