News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests
NB: Posting URL's See here: Posted URL Change

Main Menu

palettemaking with masm

Started by daydreamer, August 20, 2018, 07:17:21 PM

Previous topic - Next topic

avcaballero

Stictly speaking, there's no such a thing as palette in W32 bits, and there's no need to use it. Nevertheless we can simulate it doing easier working with some graphics effects as plasmas, etc.

You can see here an example of a fire demo wit palette. But hurry up if you want to catch up, not available for much time.


daydreamer

Quote from: caballero on August 22, 2018, 02:57:30 AM
Stictly speaking, there's no such a thing as palette in W32 bits, and there's no need to use it. Nevertheless we can simulate it doing easier working with some graphics effects as plasmas, etc.

You can see here an example of a fire demo wit palette. But hurry up if you want to catch up, not available for much time.


thats cool demo :t
I know many things was achieved with palette tricks Before when computers wasnt that powerful to do things in realtime
thats the Point,to try write something of my own inspired by palette tricks
my none asm creations
https://masm32.com/board/index.php?topic=6937.msg74303#msg74303
I am an Invoker
"An Invoker is a mage who specializes in the manipulation of raw and elemental energies."
Like SIMD coding

aw27

Quote from: caballero on August 22, 2018, 02:57:30 AM
Stictly speaking, there's no such a thing as palette in W32 bits
Probably you are talking about something you dreamed about and are redefining well know and accepted concepts.

avcaballero

All these nonsense to say that I'm wrong. If so simply give us an example, I can live with it and I will be glad to see it.

aw27

Of course you are wrong, you appear not to have the slightest idea that for 256 colors or less Windows manages colors through indexed lists of colors called PALETTES. You can use google to find tens of thousands of results explaining in detail all the mechanics, if you want of course, otherwise keep using well established names for completely different things and contribute to a more messy world.  :biggrin:

jj2007

Quote from: caballero on August 22, 2018, 02:57:30 AMStictly speaking, there's no such a thing as palette in W32 bits, and there's no need to use it.

There are still palettes around in Win32, but there is indeed no need to use them, since most machines are set on 32-bit colour depth nowadays.

aw27

There are palettes and there is a need to use them. We can't produce a GIF file with more than 256 colors and we can't prepare a FAX image with more than 2 colors.

avcaballero

As I see you have to set up your video mode to 16 bits to use the paletty apis. I had already seen it in Charles Petzold's examples but I did not bother to try it, it just did not work in my system and I invented my own way. I do not think anyone is going to worry on setting its video display mode to 256 colors to see a demo.

I will not discuss with you about it. I think we can reach an agreement: I was strictly wrong and you are an arrant pedant.

aw27

No, you will not change video mode. Actually, most modern machines are capped at 32-bit video modes. This does not prevent them from seeing 256 color GIFs for example.

Yes, it is better not to discuss further you need a full recycling seminar on the basics of these matters.  :t

jj2007

Quote from: caballero on August 22, 2018, 06:49:53 AMarrant pedant

Caballero, check if your keyboard is working properly. It seems sometimes it's missing the "o" and "g" characters.

avcaballero

> you need a full recycling seminar on the basics of these matters
Yes, with no doubt. I want to excuse if I was rude. You say something that is interesting to me, I didn't know that.

In MS-DOS you construct your palette accessing ports that basically is an array of colors. When you write on your vga memory card, let's say 13h, it knows how to show the images because you previously have constructed these array of colors and say which index you want to paint.

Any image file, let's say 8 bits as your gif or any bmp, pcx, tga, etc has inside the palette info and the color info. In no moment you need access to the palette port, you simply need to read the info in your binay file to construct your rgba color and show it. So why do you need the palette system to show a gif? You simply send the image you have constructed. At least I don't use it in my programs, just read and show.

Without double meaning, this is something I did not know and I appreciate any information about it. Is there another way to do it apart from what I already do?


JJ. I'm not an English speaker, so I won't understand any double meaning, tell me clear if you want I understand it.

PD: I'm always learning

hutch--

My Axialis IconWorkshop does "swatches" which is just another name for a pallette. One technique I have seen which is a pest with 256 color images that apart from the orginal colours in the image, you cannot edit them easily because they do not contain any other colours. I gather it is to keep the file size down.

aw27

Quote from: caballero on August 22, 2018, 08:12:39 AM
Is there another way to do it apart from what I already do?
I can't see what you have done - I can't download anything from the URL you provided. All I was doing was commenting your statment "Stictly speaking, there's no such a thing as palette in W32 bits". My feeling is that you produce the effect by changing the palette and force a re-rendering of the image but this contradicts your statement that there is no palette (strictly speaking)!

avcaballero

> I can't download anything from the URL you provided.
Yeah, so late, man. My site is no longer available. They wanted to charge me € 120 / year, so we have reached an agreement: they are left with their site and I with my money. Qué misterio

Did not read my entire post? You were alarmed in the first sentence. In VGA you can set the graphical palette on 3C8h and 3C9h ports (an array of 256 colors). This is what I understand by palette (physical). I use in memory an array of colors many times, to what I can call a logical palette, the use is very similar, but it is not the same. As far as I know Windows is no longer concerning with those ports to define a palette, that's why I said that there's no real (physical) palette but we can do one (logical) for our own purposes.

For a moment I had understood you that Windows sent the palette of 8-bits image files to the VGA palette to see them (as your gif), which left me very surprised and interested.

The fire effect has nothing to do with rotating the palette, although it has a logic one. Nothing to do with the VGA palette, you know the ports one.

aw27

VGA has gone, ports can only be accessed from kernel mode and there are no more 256 color screens.

There is one thing called a device context, which has been around since the early Windows days. When you have a 256 color bitmap (where each byte is an index into a color table), and you want it to appear on your 32-bit screen monitor a few magic steps take place to make that bitmap be transformed to the 32-bit screen color depth and be rendered to your eyes.