DOS Shadow Sprites
DOS Shadow Sprites
I understand that in DOS port the Shadow is done programmatically but anyone ever captured the images to have the sprites already changed ?
Re: DOS Shadow Sprites
Some possible paths to obtain what you want:
- Use the images of the prince, and make them partially transparent, as MININIM does.
- Use the images of the prince, and process them with custom code taken partially from SDLPoP.
- Use a terminal/shell (command-line) and run a program to process the images of the prince, for example with G'MIC or ImageMagick.
Note that - readers, correct me if I'm wrong - the bitwise xor operation is performed with two images (layers). As you can see in the attached image, the location of the shadow impacts the look of his face (and body) because of the position of the background's shadow. When using G'MIC or ImageMagick, the second layer could just be fully black. But this is why making screenshots of the game itself, for instance frame by frame to get the images, isn't ideal.
I've had no success with this, but ImageMagick's convert might be usable like this:
convert in1.png in2.png -fx "(((255*u)&(255*(1-v)))|((255*(1-u))&(255*v)))/255" out.png
(I found that on StackOverflow.)
And G'MIC like this, although I wouldn't know what value "200" should be changed into:
gmic in.png -xor 200 -o out.png
Also, GIMP has a gimp-gmic plug-in.
You'd need two layers, and then go to: Filters -> G'MIC...
- On the left, for "Input layers..." pick "All".
- Layers -> Blend [standard] -> Mode: Xor
- Apply.
Actually, I don't understand why the shadow has a white outline.
Maybe there's more going on than just a bitwise xor?
- Use the images of the prince, and make them partially transparent, as MININIM does.
- Use the images of the prince, and process them with custom code taken partially from SDLPoP.
- Use a terminal/shell (command-line) and run a program to process the images of the prince, for example with G'MIC or ImageMagick.
Note that - readers, correct me if I'm wrong - the bitwise xor operation is performed with two images (layers). As you can see in the attached image, the location of the shadow impacts the look of his face (and body) because of the position of the background's shadow. When using G'MIC or ImageMagick, the second layer could just be fully black. But this is why making screenshots of the game itself, for instance frame by frame to get the images, isn't ideal.
I've had no success with this, but ImageMagick's convert might be usable like this:
convert in1.png in2.png -fx "(((255*u)&(255*(1-v)))|((255*(1-u))&(255*v)))/255" out.png
(I found that on StackOverflow.)
And G'MIC like this, although I wouldn't know what value "200" should be changed into:
gmic in.png -xor 200 -o out.png
Also, GIMP has a gimp-gmic plug-in.
You'd need two layers, and then go to: Filters -> G'MIC...
- On the left, for "Input layers..." pick "All".
- Layers -> Blend [standard] -> Mode: Xor
- Apply.
Actually, I don't understand why the shadow has a white outline.
Maybe there's more going on than just a bitwise xor?
- Attachments
-
- bitwise xor
- bitwise_xor.png (7.01 KiB) Viewed 3810 times
Re: DOS Shadow Sprites
Thanks Norbert, great explanation.
I already did something similar to MININIM but I would prefer to have it look closer to the original.
I already did something similar to MININIM but I would prefer to have it look closer to the original.
Re: DOS Shadow Sprites
I did a quick test using Paint.Net and it seems I got good results!
Re: DOS Shadow Sprites
I managed to make the sprites look like the original, I think this is good enough
Thanks again Norbert for the tips.
Thanks again Norbert for the tips.
Re: DOS Shadow Sprites
Just to share If someone needs these sprites I'm attaching a zip with all the frames I needed to the shadow.
- Attachments
-
- shadow-dos.zip
- (86.1 KiB) Downloaded 131 times
Re: DOS Shadow Sprites
Well, that's exactly what happens if you xor the white clothes with the black background.Norbert wrote:Actually, I don't understand why the shadow has a white outline.
Maybe there's more going on than just a bitwise xor?
As a side note, the original DOS game xors the color indices instead of the RGB values.
And, the "base" image is drawn with the or blitter there, which I replaced in SDLPoP with a simple transparent blitter.
Re: DOS Shadow Sprites
That doesn't make any sense to me, but I trust your word for it.David wrote:Well, that's exactly what happens if you xor the white clothes with the black background.Norbert wrote:Actually, I don't understand why the shadow has a white outline.
Re: DOS Shadow Sprites
(Continuing the outline thing.)
Basically, if you have a row of white pixels, with black at each end, then this will happen if you xor the image with its copy shifted one pixel: (see attachment)
Black = 0, so White xor White = Black and White xor Black = White.
Basically, if you have a row of white pixels, with black at each end, then this will happen if you xor the image with its copy shifted one pixel: (see attachment)
Black = 0, so White xor White = Black and White xor Black = White.
- Attachments
-
- bitwise_xor_explain_2.png (3 KiB) Viewed 3773 times
Re: DOS Shadow Sprites
Thanks for explaining it.
With "its copy shifted one pixel" it all makes sense.
With "its copy shifted one pixel" it all makes sense.
Re: DOS Shadow Sprites
Wait, did you think the two copies are positioned exactly on top of each other?
By the way, here is how the shadow is drawn in SDLPoP: https://github.com/NagyD/SDLPoP/blob/ma ... 08.c#L1528
By the way, here is how the shadow is drawn in SDLPoP: https://github.com/NagyD/SDLPoP/blob/ma ... 08.c#L1528
Re: DOS Shadow Sprites
I initially did, yes.David wrote:Wait, did you think the two copies are positioned exactly on top of each other?