extracting shapes as PNG

NOTICE: This forum is archived as read only.
Please use the Github Discussions at https://github.com/exult/exult/discussions
Forum rules
NOTICE: This forum is archived as read only.
Please use the Github Discussions at https://github.com/exult/exult/discussions
Locked
Andrea B Previtera

extracting shapes as PNG

Post by Andrea B Previtera »

I think I am posting this twice but...
...you know, my memory has serious holes :\

I wanted to know if there's a way to batch-extract shapes in PNG format. I can do it in GIF with the Exult tools and some codearound... but no PNG. Am I wrong? Any hint?

[edit by wjp: you should really give threads descriptive subjects :-) ]
Dominus
Site Admin
Posts: 5656
Joined: Thu May 14, 2020 1:34 pm

Re: extracting shapes as PNG

Post by Dominus »

The problem is that the shapes normally contain more than one frame and png only supports one frame (shot me if I'm wrong).
The prefered way to handle these files is really the shp format and using Gimp. This way you can see the frames way better.
--
Read the documentation and the FAQ! There is no excuse for not reading them! RTFM
Read the Rules!
We do not support Piracy/Abandonware/Warez!
Andrea B Previtera

Re: extracting shapes as PNG

Post by Andrea B Previtera »

Hm, ok - I didn't actually mean Shapes but Frames. Infact you *can* extract every frame with the exult tools... only they're saved in PCX... GIF... or something like that
Dominus
Site Admin
Posts: 5656
Joined: Thu May 14, 2020 1:34 pm

Re: extracting shapes as PNG

Post by Dominus »

yeah it works fine extracting frames to pcx. Ipack might be extendable to extract all frames of a shape and save them to png.
I'm sure there are tools to batch convert pcx to pngs. In Windows you can use irfan view to do this (supports command line batch converting, I think).
--
Read the documentation and the FAQ! There is no excuse for not reading them! RTFM
Read the Rules!
We do not support Piracy/Abandonware/Warez!
wjp
Site Admin
Posts: 1708
Joined: Thu May 14, 2020 1:34 pm

Re: extracting shapes as PNG

Post by wjp »

Or you could adapt the shp2pcx utility to shp2png.
Imajin

Re: extracting shapes as PNG

Post by Imajin »

Actually I rigged up a simple method once...

If you have the Exult tools, copy "SHAPES.VGA" (for example) and PALLETES.FLX to that folder, and make two files in Notepad.

One should be a batch (.bat) file with one line:
ipack -x test.txt

Name the other test.txt, and put the following lines into it:
archive SHAPES.VGA
palette PALETTES.FLX
xxx/32: /

Relace XXX with the shape number, which I beleive can be discovered in Exult Studio. Also, the 32 is the number of frames the average character shape has (Remember, though Studio says 31, 0 is counted in that). Other shapes may have mroe or less.
Andrea B Previtera

Re: extracting shapes as PNG

Post by Andrea B Previtera »

The point is that when IPack extracts frames to PCX, the transparency mask is lost! Otherwise of course I'd be batch converting to PNG...
drcode
Site Admin
Posts: 2267
Joined: Thu May 14, 2020 1:34 pm

Re: extracting shapes as PNG

Post by drcode »

Ipack is losing transparency info? That's a bug.
Andrea B Previtera

Re: extracting shapes as PNG

Post by Andrea B Previtera »

Yes, pcx files (at least with the last Ipack I used! I don't know now) haven't transparency information
drcode
Site Admin
Posts: 2267
Joined: Thu May 14, 2020 1:34 pm

Re: extracting shapes as PNG

Post by drcode »

I thought ipack produced .png's.
Colourless
Site Admin
Posts: 731
Joined: Thu May 14, 2020 1:34 pm

Re: extracting shapes as PNG

Post by Colourless »

Are you sure that you are not making a mistake. If there isn't transparency information in the format, then the transparent colour is Index 255.
Andrea B Previtera

Re: extracting shapes as PNG

Post by Andrea B Previtera »

Maybe it's just a photoshop glitch then - since PNG and GIF files are correctly transparency-masked once loaded, while PCX files are not..
Andrea B Previtera

Re: extracting shapes as PNG

Post by Andrea B Previtera »

After PCX dissection I can confirm it: no transparency info! :(
Is there any hope of PNG output with some future release of the tools?
Andrea .B. Previtera

Re: extracting shapes as PNG

Post by Andrea .B. Previtera »

Hee-hoo! Here we go with the monthly call about PNG output from the Exult tools :) Sorry, it's not plain lazyness: I'd happily contribute to the code and add it by myself, but I should learn the png format, how to compile exult, etc. etc. - which I really don't have time to : (

Any kind soul out there?
drcode
Site Admin
Posts: 2267
Joined: Thu May 14, 2020 1:34 pm

Re: extracting shapes as PNG

Post by drcode »

You can look at Exult's use of the PNG library in the 'shapes' directory.
Withstand the Fury Dragon

Re: extracting shapes as PNG

Post by Withstand the Fury Dragon »

What about IrfanView? Doesn't that do batch conversions between format with the option to preserve transparency?

http://www.irfanview.com/

:) WtFD
Withstand the Fury Dragon

Re: extracting shapes as PNG

Post by Withstand the Fury Dragon »

EDIT: I thought it let me define a transparent colour for each image, as well. In fact, I recall as much, because it helped me do some PNG image-compression (with preservation of transparency) for a friend's website.

:) WtFD
Locked