Re: [AD] Question about 256 colors modes

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


I just wanted to chime in on this topic.
 
1) There was a time when certain hardware makers forced color 0 to be black.  You could not change this, and so much of the 256-color code I've seen since I started game programming sticks to this ideal.  I used to have a 386 whose index 0 color refused to be written to (which annoyed the hell out of me when I was learning assembly and spent a week searching for a bug which wasn't in my code).
 
2) Many animation programs used a lot during the 256-color era, like Autodesk Animator Studio, also stuck to keeping 0 black most of the time, and most palettes were generated with this in mind back then.
 
3) In Photoshop you *can* set transparent colors to a single, solid color using the "Save for Web..." menu option.  I can't remember exactly what it looks like off the top of my head, but if you turn off transparency when exporting to GIF or PNG-8 and then select a matte color, the matte color will fill all areas that are transparent in your image (and will also blend with semi-transparent areas I think).  You can then use another program to rearrange the color palette in your image so that the transparent color is moved to index 0 -- just write a quick program to swap the palette indices and then swap the pixels in the image.  It'll take you an hour, tops.


----- Original Message ----
From: Hugo Daniel Caro <hugo_caro@xxxxxxxxxx>
To: alleg-developers@xxxxxxxxxx
Sent: 2005年12月15日 1:40:59
Subject: RE: [AD] Question about 256 colors modes


Hi Vincent!

I've asked our "Photoshop guru" about your concerns,
and the told me that, in fact, Photoshop doesn't have
the "transparent color" concept on generating the
color palette for Indexed colors.

Is different with others programs like Animated GIF
generators or Icons creators (where the "transparent"
concept is included).

In my case, I've downloaded a little freeware program
(PEdit 0.9.1) which allowed me to left-shift all the
color indexes until the color 0,0,0 was placed at
index 0 as we needed for allegro.

I guess Photoshop is popular enough to find that this
issue may arise to any other developer. May be a
"quick and dirty" solution would be to have a test
program that "reorders" the palette so it gets the
transparent color wanted (if it's not placed at index
0).

Kind regards, Hugo.


--- Vincent Penecherc'h
<Vincent.Penecherch@xxxxxxxxxx> escribió:

> > I don't get which "program" do you say I've "told"
> to
> > generate black or transparent.
> 
> The graphics program you used to create the image
> (which
> you said to be, eg, Photoshop).
> 
> What I meant is, as far as that program's concerned,
> there isn't any reason to make black transparent if
> you haven't told it to (eg by having a mask, or
> similar).
> From what you said earlier, I think you haven't
> "told"
> eg Photoshop that you intended whatever black bits
> of
> your images to be interpreted as transparent, so
> that's
> probably why black went in as a random place in the
> palette (254 in your case), as black doesn't have
> any
> particular significance for it, as opposed to a
> color
> which is transparent.
> 
> In any case, if you want to create 8 bit images, you
> will have to control the palette, or you'll likely
> run
> into more problems (eg, if two sprites sharing the
> same
> palette do not actually have the same palette
> ordering
> due to eg Photoshop generating different orderings.
> If
> you already manage your palettes, then you'll know
> where
> your black and transparent colors are, so this will
> not
> be a problem.
> 
> Again, I have to guess at what you may be doing, so
> this
> may or may not apply.
> 
> > - I've used another platforms (and hardware) where
> the
> > index color for transparent can be set, and didn't
> > found any significant delay. May be on allegro is
> not
> 
> Possibly, I was just saying this to make sure this
> got
> considered, I do not have timings or anything. All I
> know is that, out of 7 usable general purpose
> registers
> on x86, I've always found I could have done with a
> few
> more :)
> 
> 
> 
>
______________________________________________________________________
> This email has been scanned by the MessageLabs Email
> Security System.
> For more information please visit
> http://www.messagelabs.com/email 
>
______________________________________________________________________
> 
> 
>
-------------------------------------------------------
> This SF.net email is sponsored by: Splunk Inc. Do
> you grep through log files
> for problems?  Stop!  Download the new AJAX search
> engine that makes
> searching your log files as easy as surfing the 
> web.  DOWNLOAD SPLUNK!
> http://ads.osdn.com/?ad_idv37&alloc_id865&op=click
> --
>
https://lists.sourceforge.net/lists/listinfo/alleg-developers
> 



    


    
        
___________________________________________________________ 
1GB gratis, Antivirus y Antispam 
Correo Yahoo!, el mejor correo web del mundo 
http://correo.yahoo.com.ar 



-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
-- 
https://lists.sourceforge.net/lists/listinfo/alleg-developers




Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/