Example image manipulations with little bug lazarus / 39-Graphics ---------------------------------------------------------------------- xinyiman · 2019-11-06 11:10 Hi guys, for a recent job I had to develop a library to implement the most common image manipulations. That's why I created a public project on GitHub at https://github.com/XinYiMan/simple_image_manipulation I tested on Mac OS X and apart from a mismatch on the manipulation of the gamma value seems to work well. So if someone were to serve, he didn't reinvent the wheel all the time. The problem is in the manipulation of the gamma value. If I take an image and do the gamma encoding it works fine. If I then apply the decode gamma immediately it seems to not work. But if I result from the encode gamma save it on a file which I then re-import and apply the decode range then it works. I don't understand why. Who explains to me what is wrong? ---------------------------------------------------------------------- xinyiman · 2019-11-06 11:16 My image gamma manipulation test ---------------------------------------------------------------------- circular · 2019-11-06 13:36 Hi, After writing directly to pixel data, you need to call InvalidateBitmap. On MacOS, it won't work otherwise because the pixel data is not linked to the bitmap handle. Note that using Canvas property is not recommended as it requires copying from the bitmap handle and vice versa. Also the alpha channel is not well supported by Canvas. For example, to copy a part, you can directly use the GetPart function. Otherwise if you want functions that are Canvas-like, you can safely use CanvasBGRA property instead. Regards ---------------------------------------------------------------------- xinyiman · 2019-11-06 13:50 Quote from: circular on November 06, 2019, 02:36:38 pmHi, After writing directly to pixel data, you need to call InvalidateBitmap. On MacOS, it won't work otherwise because the pixel data is not linked to the bitmap handle. Note that using Canvas property is not recommended as it requires copying from the bitmap handle and vice versa. Also the alpha channel is not well supported by Canvas. For example, to copy a part, you can directly use the GetPart function. Otherwise if you want functions that are Canvas-like, you can safely use CanvasBGRA property instead. Regards Thank you. With InvalidateBitmap after pixel editing run correctly on Mac OS X.