treeform / pixie

Full-featured 2d graphics library for Nim.
MIT License
732 stars 28 forks source link

Working with pixel size <= byte #538

Open arkanoid87 opened 1 year ago

arkanoid87 commented 1 year ago

Hello!

I work with large images for geosciences with Nim and I was looking for an efficient rasterizer while keeping everything in memory To archieve this, working with sizeof(pixel) <= 8 bits is a must

Cairo has FORMAT_A1 and FORMAT_A8 for this https://www.cairographics.org/documentation/pycairo/3/reference/constants.html#cairo-format

FORMAT_A8 is the easiest way to work on the gpu like

glTexImage2D(GL_TEXTURE_2D, 0, GL_RED, width, height, 0, GL_RED, GL_UNSIGNED_BYTE, image_data);

I strongly prefer a 100% Nim solution, is Pixie capable of working with single channel images?

guzba commented 1 year ago

Hi, Pixie does not have multiple different image formats so will not meet this requirement.

It is complex to support many image data formats with optimized drawing code paths etc so this is not something I see myself working on since I do not need it.

arkanoid87 commented 1 year ago

Thanks for the quick feedback!

I'll stick with Cairo then (until I figure out how to work with multiple independent uint8 layers packed as a multichannel pixie image)

should I close this issue, or keep it for votes?