I have stored an image in a Matrix{RGB24}.
When i save the image to a jpg file, i get the expected result. When i save the image to a png file, it looks very wrong.
I am using Julia v1.11.3 and Images v0.26.2.
Minimal Working Example:
using Images, ColorTypes
# Fill a matrix with 4 random colors:
image = zeros(RGB24, 100,100)
image[1:50,1:50] .= RGB24(1, 1, 1)
image[50:100,50:100] .= RGB24(1, 0.7, 0.5)
image[1:50,50:100] .= RGB24(0.32, 0.9, 0.01)
image[50:100,1:50] .= RGB24(0.85, 0.52, 0.1)
# Save to jpg and png:
save("image.jpg", image)
save("image.png", image)
image.jpg (looks ok):

image.png (looks wrong):

EDIT: Better example
I have stored an image in a
Matrix{RGB24}.When i save the image to a jpg file, i get the expected result. When i save the image to a png file, it looks very wrong.
I am using Julia v1.11.3 and Images v0.26.2.
Minimal Working Example:
image.jpg (looks ok):
image.png (looks wrong):
EDIT: Better example