sketch icon indicating copy to clipboard operation
sketch copied to clipboard

Changed colors with load image

Open ulrivo opened this issue 6 years ago • 5 comments

If I load a PNG-file, instead of red the color blue is rendered.

(defsketch image ((title "image") (width 500) (height 600)) (image (load-resource "png/my-image.png") 100 50)

ulrivo avatar Oct 14 '19 05:10 ulrivo

Hey @ulrivo,

Is this the same for every image? Which platform are you on? (lisp, os) If not all images are shown like this, could you send me the exact image you're using?

Thanks!

vydd avatar Oct 14 '19 11:10 vydd

I tried different PNG-files, the colors are always twisted - wrong texture?

I am using CCL64 (Clozure Common Lisp Version 1.11.6 DarwinX8664) on Mac OS X and attach a PNG which is shown in blue instead of red.

10_of_hearts

ulrivo avatar Oct 14 '19 17:10 ulrivo

I have the same issue, changing :bgra to :rgba here solves this problem. SBCL 2.1.5 Manjaro x64

n00p3 avatar Jun 07 '21 23:06 n00p3

@n00p3 any ideas on how we could identify the correct parameter here?

vydd avatar Jul 31 '21 21:07 vydd

@vydd Quick & dirty solution would be to use imagemagick to identify colorspace of image identify -verbose image.png | grep Colorspace | awk '{ print $2 }' but this is far from acceptable answer. I don't know much of OpenGL to help with this topic. How about letting user specify format when loading resource? Something like this (load-resource "image.png" :format :rgba)

n00p3 avatar Aug 01 '21 11:08 n00p3