[SDL] importing an image with alpha from Paint Shop Pro

CRV§ADER /KY crusader at inwind.it
Fri May 9 06:23:01 PDT 2003


I've got an image created with paint shop pro that has some 
semi-transparent pixels in it and I want to use it with my SDL application.
The first try I've made has been to set the background color to purple 
(0xFF00FF), merge all layers and save it to PNG; then load the image with 
SDL_image and set the colorkey to 0xFF00FF. This works for the pixel with 
opacity 100% or 0%, but it doesnt't with semi-transparent ones (which are 
blended with the background).

(1) Is there a file format both supported by psp7 and by some SDL library 
that can store a RGBA surface?
(2) Is there some SDL library that can load  a psp image into SDL surfaces? 
(the PSP file format specs are public, but they''e 77 pages long...)
(3) are there any other alternatives?

I've thought about saving the image with two different backgrounds, i.e. 
purple (0xFF00FF) and green (0x00FF00) and, by comparing the RGB pixels in 
the two surfaces, revert to the original RGBA image. However, this is quite 
a pain in the a** - and it's a bad, dirty work too.




[] Guido Imperiale
[] CRV§ADER/KY
[] CVI.SCIENTIA.IMPERIVM

crusaderky at libero.it
http://crusaderky.da.ru


"Nam et ipsa scientia potestas est" (Knowledge is power)
      -- Sir Francis Bacon (1561-1626)
         Meditationes Sacrae, de Haeresibus


"I worry about my child and the Internet all the time, even though she's 
too young to have logged on yet. Here's what I worry about. I worry that 10 
or 15 years from now, she will come to me and say 'Daddy, where were you 
when they took freedom of the press away from the Internet?'"
         --Mike Godwin, Electronic Frontier Foundation





More information about the SDL mailing list