Page 1 of 1
Transparency on new animations?
Posted: Mon Dec 03, 2018 2:00 am
by Knight Captain
I'm trying to convert the red fire field into a green flame for AgentOrangeMan.
As with prior recolors, I used ImageMagick to swap specific colors for others:
magick convert 895_fire_field_%02d.png[0-15] -fill #14a400 -opaque #dc1428 -fill #1cc000 -opaque #e06c00 -fill #28dc00 -opaque #fc7c00 -fill #38fc00 -opaque #ecc828 -fill #50fc28 -opaque #ecd050 -fill #6cfc54 -opaque #fcac5c -fill #8cfc80 -opaque #f0dc78 -fill #b0fcac -opaque #f4e4a4 -fill #d8fcd8 -opaque #f8f0cc -fill #28dc00 -opaque #5c5cfc -fill #1cc000 -opaque #fc9c3c -fill #14a400 -opaque #fc8c1c -define png:preserve-colormap=true green_flame_%02d.png[0-15
This works rather nicely, except that the new PNGs need to be put back into Indexed Color via GIMP.
But somewhere along the way, the multiple "white" colors of #fcfcfc seem to cause a problem. There are four of these used in the palette, so the imported frames seem to be stuck on the first one. There are two for "magic blue" and "magic red" as well as a yellow-tinted transparency that I want to use.
I've tried tinkering with the palette prior to exporting the images from GIMP, but I can't seem to find the right way to do this. How do I keep the proper transparency?
Re: Transparency on new animations?
Posted: Mon Dec 03, 2018 2:26 am
by Knight Captain
Grafx2 also shows I'm using the right color in the palette list.
Re: Transparency on new animations?
Posted: Mon Dec 03, 2018 6:28 pm
by Dominus
It's been a while and I remember it not being easy. And I'm not entirely sure, but in the palette the last 15 colors are transparent with the transparent colors being:
1 yellow
2 blue
3 bright green
4 bright red
5 purple
6 dark brown
7 very bright green
8 grass green
9 dark yellow/bright orange
10 blue (white color underneathi it turns black)
11 dark green
12 red
13 white
14 dark gray
15 bright gray
BUT the colors you see in the palette do not match those
Take a look at the transparent shortcutbar icons. All the sb_???.shp files in
https://github.com/exult/exult/tree/master/data
Re: Transparency on new animations?
Posted: Tue Dec 04, 2018 7:31 am
by Knight Captain
Interesting that the palette that comes with a SHP file is different than the one included in an export of frames to PNG. From a quick look, not only are the whites just slightly different colors, but every single color has a different HTML notation number. The last 8 colors are totally different as well.
So I'll take another crack at it.
It looks like the Palettes.FLX file is used as the color map for the PNG exports, but it may be better off using the same one that SHP files use.
Re: Transparency on new animations?
Posted: Tue Dec 04, 2018 10:04 am
by Dominus
Yes, sorry for not mentioning this, but you have to make sure you use the shp palette. And then the problem was that the automatic color assigning likes to use the transparent colors or the color cycling colors ...It was driving me nuts
Re: Transparency on new animations?
Posted: Wed Dec 05, 2018 12:44 am
by Knight Captain
It seems the main thing that tripped me up here was Exult Studio exporting PNGs with approximately Palette 0, rather than the one that should be used.
Would it be possible to get the Exult Studio Export feature to use the correct palette for PNGs? It would make a difference in speeding up the recoloring process.
It looks like the correct export to PNG steps currently are to:
Use ES to export the given shape as a SHP.
Open that SHP in GIMP with the plugin.
Use GIMP to save each frame, using gimp-plugin-export-layers.
From there, the usual ImageMagick steps should work.
I created a local HTML page with all the correct-for-editing colors, as well as a table with the approximate light-dark equivalents for swapping.
Re: Transparency on new animations?
Posted: Wed Dec 05, 2018 1:41 am
by Knight Captain
I'm still not getting the expected results. Even if the colors are the same between the original and new shapes, and the settings are the same, I get different results.
Now I'm getting a transparent blue when I am expecting a transparent orange.
The Translucent flag has to be set on the shape, but without it that cycles orange, rather than blue.
Re: Transparency on new animations?
Posted: Wed Dec 05, 2018 2:16 am
by Knight Captain
Is it possible the engine is selecting the transparent color based on nearby pixels in the same shape?
Re: Transparency on new animations?
Posted: Wed Dec 05, 2018 3:29 am
by Knight Captain
Here's a video of the Translucent vs. Transparent results, with the Quality Flags set on both test shapes:
Direct link:
https://i.imgur.com/ZqRuwD6.mp4
Both of the flame shapes are set to Translucent only.
Is this stuff documented?
Re: Transparency on new animations?
Posted: Wed Dec 05, 2018 3:50 am
by Knight Captain
I'm even more confused now. I went back to the palette that Exult Studio gives to Exported Frames (PNGs) and setup test shapes with the same settings, Translucent vs. Transparent. I now have even more colors than I expected. Isn't Ultima 7 limited to 256 colors at once?
https://i.imgur.com/i1C5VQ0.mp4
Re: Transparency on new animations?
Posted: Wed Dec 05, 2018 9:03 am
by Dominus
can you upload the shapes, so I can have a go at it?
Re: Transparency on new animations?
Posted: Wed Dec 19, 2018 3:20 pm
by Knight Captain
So it turns out that ImageMagick has documented switches that were never implemented, if I'm reading this thread correctly:
https://www.imagemagick.org/discourse-s ... e+colormap
That would explain why even with the "correct" command line options, it truncates the palette per PNG to only the colors used in the image.
So when those PNGs are put back into the correct U7 palette, since there are multiple uses of #fcfcfc the first one is always picked, and that is not transparent.
Re: Transparency on new animations?
Posted: Sat Dec 29, 2018 4:06 am
by Knight Captain
Looking at the Kylista shape (SI#560) on Frame 9 there is at least one square with color #867a43. But that isn't part of the usual palette.
There's other "unfinished" bits of her shape as well.
Red hands on several frames.
The sitting frame, 10, has a pixel in the lower right corner.
The sleep frame, 13, has extra pixels under the foot.
Frame 14 has color #8c6743, also not in the palette.
And a few more oddities.
Re: Transparency on new animations?
Posted: Thu Feb 21, 2019 6:43 pm
by Knight Captain
[url=
https://www.imagemagick.org/discourse-s ... 49#p163749]I bumped this topic on the ImageMagick.org forum today[url].
The alternative way we could handle this would be to export using the SHP format palette, which has no duplicates. The whites used a just a shade or two different.