Image of 8bpp in a surface of 8bpp

I’m having problem with an image loaded with SDL_image and displayed in
a 640x480x8 screen.
This image is a jpg and when displayed in 640x480x8 it gets distorced,
but with 640x480x16 it
does not get distorced. But in my mind if the image is 8bpp and is going
to be displayed in a
screen of 8bpp that no big deal.Anyone can help me??
Thanks…–
Fausto Carvalho

Does the distortion just consist of unmatched colors? This would indicate
that you have not set the correct palette for your 8-bit screen surface.
That’s why it would work in 16-bit mode - no palette info is needed. I would
guess that your jpg is not a palettized image anyway, as most aren’t, so
you’ll probably want to reduce its color palette to 256 colors anyway, to
display it on an 8-bit screen. If you actually are starting with an 8-bit
image, then you just need to load the appropriate palette.
-Dave> ----- Original Message -----

From: fausto@tse.gov.br (Fausto Carvalho Marques SIlva)
To:
Sent: Thursday, March 27, 2008 12:21 PM
Subject: [SDL] Image of 8bpp in a surface of 8bpp

I’m having problem with an image loaded with SDL_image and displayed in
a 640x480x8 screen.
This image is a jpg and when displayed in 640x480x8 it gets distorced,
but with 640x480x16 it
does not get distorced. But in my mind if the image is 8bpp and is going
to be displayed in a
screen of 8bpp that no big deal.Anyone can help me??
Thanks…


Fausto Carvalho


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

How can i get the correct palette from a JPG image??

David Olsen wrote:>Does the distortion just consist of unmatched colors? This would indicate

that you have not set the correct palette for your 8-bit screen surface.
That’s why it would work in 16-bit mode - no palette info is needed. I would
guess that your jpg is not a palettized image anyway, as most aren’t, so
you’ll probably want to reduce its color palette to 256 colors anyway, to
display it on an 8-bit screen. If you actually are starting with an 8-bit
image, then you just need to load the appropriate palette.
-Dave

----- Original Message -----
From: “Fausto Carvalho Marques SIlva” <@Fausto_Carvalho_Marq>
To:
Sent: Thursday, March 27, 2008 12:21 PM
Subject: [SDL] Image of 8bpp in a surface of 8bpp

I’m having problem with an image loaded with SDL_image and displayed in
a 640x480x8 screen.
This image is a jpg and when displayed in 640x480x8 it gets distorced,
but with 640x480x16 it
does not get distorced. But in my mind if the image is 8bpp and is going
to be displayed in a
screen of 8bpp that no big deal.Anyone can help me??
Thanks…


Fausto Carvalho


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


Fausto Carvalho
3316-3808
TSE/STI/CSELE/SEVIN

El Mi?rcoles 02 Abril 2008ES 20:38:08 Fausto Carvalho Marques SIlva escribi?:

How can i get the correct palette from a JPG image??

Use a graphics manipulation program as the Gimp to reduce the image to 256
colours and save it in a format that can hold 8-bit images (such as bmp).