![(Solved) LVGL image inverted and rough edge artifact issue](/_gatsby/image/952b18be2dd06b7368324d93d06a881d/6a4442a5362116c62ad150782b35ffca/LVGL-inverted-image-and-artifact-rough-edge-issue.png?u=http%3A%2F%2Fwp.docker.localhost%3A8000%2Fwp-content%2Fuploads%2F2023%2F09%2FLVGL-inverted-image-and-artifact-rough-edge-issue.png&a=w%3D200%26h%3D95%26fm%3Dpng%26q%3D75&cd=23a769011ec543cc61bd6cccfe365e3c)
(Solved) LVGL image inverted and rough edge artifact issue
I had asked the question on Stack exchange here and had answered myself with a fix after I found out how to fix it.
Summary of the issue
I have ILI9341 320x240px TFT LCD screen which I am using with an ESP32-S3-wroom-1 module.
![(Solved) LVGL image inverted and rough edge artifact issue](https://res.cloudinary.com/anilmaharjan-com-np/image/upload/f_avif/q_auto/c_scale,w_389/v1/Blog/3TBsv.jpg?_a=DATAdtDeZAA0)
I have tested with TFT_eSPI and it works fine, but when using LVGL, I am seeing weird artifacts on the edges and a lot of green 😀 , it looks as if it is inverted.
Solution
Turns out, I had to disable LV_COLOR_16_SWAP
I had been trying with different color depths and everything else, I still cannot see gradients appropriately drawn, but the colors seem to be correct now. Please vote up the answer and the question on Arduino stack exchange
![(Solved) LVGL image inverted and rough edge artifact issue](https://res.cloudinary.com/anilmaharjan-com-np/image/upload/f_avif/q_auto/c_scale,w_415/v1/Blog/i4Xff.jpg?_a=DATAdtDeZAA0)
Remark
The projects exported using Squareline Studio also tend to have the same issue. There is a request to fix that here.