Jump to content

Graphic issues with created bam-files for items. Advice would be welcome


Recommended Posts

Either there or select your BAM or another BAM in the directory tree on the left and click "Edit." What I said about getting rid of nearly black colors and raising the transparency threshold (temporarily) was all for this tool.

Link to comment

Sorry for the delayed response; I had a busy weekend.  There is a lot here, so I will try to answer the questions one at a time, and then FWIW I will attempt to show you how I would have made the BAM.

On 8/8/2020 at 2:49 AM, Alexander12 said:

Thanks, yes, i have installed the latest version of Bam workshop 2. But it doesn't open PNG files:

a5073084f44d.png

This is telling you that BAMWorkshop II expects a "Paletted" (8-bit [or possibly less]) or "True Color" (24-bit) PNG.  The ones you sent me were all "TrueColorAlpha" (32-bit).  BAMWorkshop and BAMWorkshop II were written before the game engines supported the alpha channel in the palette, so they can't handle alpha channels properly or at all.

 

On 8/8/2020 at 2:49 AM, Alexander12 said:

And if i import BMB here, and save to BAM, the background in it is not transparent .

You mean BMP?  In BAMWorkshop II, you really want to convert the palette to unpaletted, import the frames, then convert back to paletted.  Again, BAMWorkshop II has a lot of bugs, so it's best do do this one step at a time:  do one thing, save, close, reopen, next step, repeat.

 

On 8/8/2020 at 3:06 AM, Alexander12 said:
On 8/6/2020 at 4:36 PM, Sam. said:

For best compatibility with all games, the transparent color should be pure green RGB(0,255,0) and the shadow color (if applicable) should be pure black RGB(0,0,0).  Depending on the tool you use to turn the images into a BAM, it may be necessary to have these transparent and shadow colors located at palette entry 0 and 1 respectively in your images.

Thanks, i tried, but the green background doesn't disappear at all:

7cc9f4ab5053.png

To do this in DLTCEP, you'll want to go to Tools->Uncompress all, then Palette->Edit Palette.  Next, find the index of your background color.  In your case it is Color # 107 which is RGB(0,254,0).  Note that it SHOULD HAVE BEEN RGB(0,255,0).  Go ahead and correct that now.  Then enter that number into the "Transparent index" box:

PS_DLTCEP1.png.4727d7418a2d960d4d31f179a4e69f75.png

Then go to Palette->Order Palette.

 

On 8/8/2020 at 3:07 AM, Alexander12 said:
On 8/6/2020 at 4:36 PM, Sam. said:

 it may be necessary to have these transparent and shadow colors located at palette entry 0 and 1 respectively in your images.

Thanks, but i can't understand how this can be done. Is it possible to make so in DLTCP? And how? Or BAM workshop?

It varies, see above for steps to do it in DLTCEP (setting transparent index and ordering palette).  For BAMWorkshop II, using the proper pure green and pure black colors, converting the BAM to unpaletted, importing the frames, and converting the BAM back to paletted should be enough to properly order the palette.  I don't remember for absolute sure about BAMWorkshop, but I'm pretty sure using the proper transparent and shadow colors (they must be exact) in the images you import is enough to properly order the palette.

 

On 8/8/2020 at 3:21 AM, Alexander12 said:

DLTCP open files from it now, but it's background  is not transparent(.

I was able to open both the BAMs you send me with the latest version of DLTCEP.  See above for setting transparent color.

 

On 8/8/2020 at 3:21 AM, Alexander12 said:

Command line tools? You mean WEIDU? Oh, this is a dark wood  for me now.

I mean ImageMagick and PS BAM, which is what I prefer to use but they do require you to have basic knowledge of running a non-gui based program.

 

On 8/8/2020 at 3:21 AM, Alexander12 said:

Yes, this is an icon for inventory item.

Inventory icons in the classic games used two different sized icons, a large one that was no bigger than 64x64 px, and a small one that is no larger than 32x32 px.  The large icon almost always has a "shadow".

ExLS.png.61c719b8ce084d1c7a66029ffa22f6cc.png

The large icon is in Sequence 0 and the small icon is in Sequence 1.  [Sequence aka Cycle]  The small icon was used when the icon was sitting in your inventory, and the large icon was used when you picked it up.  Some versions of the EEs dropped the small icon and use a resized version of the large for everything.  If you want to reproduce the classic behavior, add the small icon as a second frame in Sequence 0.  Each frame requires specific offsets in order to be positioned properly in the game.  For best compatibility with all games, the XOffset and YOffset of the large frame should be width/2 and height/2 respectively.  The XOffset and YOffset of the small frame should be (width-32)/2 and (height-32)/2.

Edited by Sam.
Link to comment
On 8/8/2020 at 4:24 AM, Alexander12 said:

I don't know if this is the best way, but i guess it will will go for now.  Pity that edges of the cloack are not very good. I don't know if there are proper tools in BAM workshop to fix it, like in Photoshop.

c3e4ac8b0b0c.jpg

Your original image used semi-transparent anti-aliasing.  These semi-transparent pixels got blended with the background color (either black or green) which produce the "halo" effect around your image as well as the individual dark pixels floating around your image when you essentially converted it to 24-bit with either mspaint or one of the BAM editors.  You can manually edit out these pixels using a graphics editor as temnix suggests, but I believe there are more sophisticated options.  Give me a bit to experiment and I'll see what can be done.

Link to comment
20 minutes ago, Sam. said:

Your original image used semi-transparent anti-aliasing.  These semi-transparent pixels got blended with the background color (either black or green) which produce the "halo" effect around your image as well as the individual dark pixels floating around your image when you essentially converted it to 24-bit with either mspaint or one of the BAM editors.  You can manually edit out these pixels using a graphics editor as temnix suggests, but I believe there are more sophisticated options.  Give me a bit to experiment and I'll see what can be done.

When downscaling to an icon, I like to:

  1. Downscale using nearest neighbor to create a clean outline.
  2. Create a duplicate downscale using bicubic sharper instead.
  3. Create a third non-sharp bicubic downscale and do a 25% paste over the sharp version because bicubic sharper is good at getting the details, but is usually just a little bit too sharp for pleasant viewing (...and this method creates a better result than trying to do like gaussian blur after the fact or something).
  4. Paste the contents of the bicubic downscale inside of the nearest neighbor outline (selecting only pixels that are occupied, ignoring transparent or green pixels in order to still have a clean outline with no pesky green anti-aliasing artifacts).
  5. Tweak the outline as necessary - there may be a few pixels where there shouldn't be anything, or maybe there's a few pixels that are transparent/green that shouldn't be, fill/remove them as necessary.
Edited by Bartimaeus
Link to comment

Initiate the transvocational coolant protocol, amplify delta to the nth velocity and depropagate the nunchaki-dependant hydrovotaticon. 🙄

Just start making these images big, draw them big or blow them up to 500% so that you can use Paint's brushes for shading without having to squint at pixels. Use broad strokes, then run a black watercolor brush around the ages to tint them down, finally fill the background with black, exit and resize the image. The black will blend by itself with the nearest colors naturally, and pure black will remain for transparency. Paint isn't a perfect painting tool for sure, but it's the simplest. The only effects I haven't managed there was if I wanted a gradual change of lighting across an image. For that I import the images to ArtRage.

Link to comment

So here's my swipe at it.  Create a BAT file with the following contents and run it.  You will need ImageMagick and PS BAM, and you will either need them added to your PATH or modify the script to point to the EXEs directly.  Adjust the paths as appropriate.

REM EE-only single frame item icon with transparency, no shadow
magick.exe convert original.png -background lime -alpha Background -fill lime -fuzz 25%% -opaque none -trim -sample 64x64^> CloakA.png
"D:\Program Files\GitHub Projects\PS-BAM\PS BAM_x64.exe" --AdvancedFLTCompression 1 --AdvancedZlibCompress 2 --AllowShortPalette 1 --AlphaCutoff 10 --AutodetectPalettedBAM 1 --AutodetectPalettedThreshold 500 --BAMProfile "Zero" --Compress 1 --DebugLevelL 1 --DebugLevelP 2 --DebugLevelS 1 --DropDuplicateFrameData 1 --DropDuplicateFrameEntries 1 --DropDuplicatePaletteEntries 1 --DropEmptyCycleEntries 1 --DropUnusedFrameData 1 --DropUnusedFrameEntries 1 --DropUnusedPaletteEntries 1 --ExportFrames "" --ExportFramesAsSequences 0 --ExportPalette "" --ExtraTrimBuffer 2 --ExtraTrimDepth 3 --FindBestRLEIndex 0 --FixPaletteColorErrors 1 --FLTSanityCutoff 720 --ForceShadowColor 2 --ForceTransColor 1 --IntelligentRLE 1 --ItemIcon2EE 0 --MaxRLERun 255 --OrderOfOperations PCE --ReduceFrameColumnLT 1 --ReduceFramePixelLT 1 --ReduceFrameRowLT 1 --ReplacePalette "" --ReplacePaletteMethod Quant --Rotate 0 --Save "BAM" --SearchTransColor 1 --SetXOffset "" --SetYOffset "" --SingleGIF 0 --TrimFrameData 1 --Unify 0 --VerifyOutput 0 --zopfliIterations 5000 --LogFile "D:\AutoHotkey Scripts\Alexander12 BAM\Log.txt" --OutPath "D:\AutoHotkey Scripts\Alexander12 BAM" "D:\AutoHotkey Scripts\Alexander12 BAM\CloakA.png"
del CloakA.png


REM EE+Classic item icon, no transparency, with shadow
magick.exe convert original.png -background lime -alpha Background -fill lime -fuzz 25%% -opaque none -alpha off -trim CloakB.png
magick.exe convert CloakB.png -fill "#00FF00" -opaque "#000000" -trim -sample 60x60^> RemoveShadow.png
magick.exe convert RemoveShadow.png -fill "#000000" +opaque "#00FF00" -bordercolor "#00FF00" -border 4 Shadow.png
magick.exe convert RemoveShadow.png -transparent "#00FF00" RemoveShadow.png
magick.exe composite RemoveShadow.png Shadow.png NewWithShadow.bmp
magick.exe convert NewWithShadow.bmp -trim -type Palette -compress none BMP3:CloakB_Sequence_0000_Frame_0000.bmp
magick.exe convert CloakB.png -sample 32x32^> -trim -type Palette -compress none BMP3:CloakB_Sequence_0001_Frame_0000.bmp
del CloakB.png Shadow.png RemoveShadow.png NewWithShadow.bmp
"D:\Program Files\GitHub Projects\PS-BAM\PS BAM_x64.exe" --AdvancedFLTCompression 1 --AdvancedZlibCompress 2 --AllowShortPalette 1 --AlphaCutoff 10 --AutodetectPalettedBAM 1 --AutodetectPalettedThreshold 500 --BAMProfile "ItemIcon" --Compress 1 --DebugLevelL 1 --DebugLevelP 2 --DebugLevelS 1 --DropDuplicateFrameData 1 --DropDuplicateFrameEntries 1 --DropDuplicatePaletteEntries 1 --DropEmptyCycleEntries 1 --DropUnusedFrameData 1 --DropUnusedFrameEntries 1 --DropUnusedPaletteEntries 1 --ExportFrames "" --ExportFramesAsSequences 0 --ExportPalette "" --ExtraTrimBuffer 2 --ExtraTrimDepth 3 --FindBestRLEIndex 0 --FixPaletteColorErrors 1 --FLTSanityCutoff 720 --ForceShadowColor 2 --ForceTransColor 1 --IntelligentRLE 1 --ItemIcon2EE 1 --MaxRLERun 255 --OrderOfOperations PCE --ReduceFrameColumnLT 1 --ReduceFramePixelLT 1 --ReduceFrameRowLT 1 --ReplacePalette "" --ReplacePaletteMethod Quant --Rotate 0 --Save "BAM" --SearchTransColor 1 --SetXOffset "" --SetYOffset "" --SingleGIF 0 --TrimFrameData 1 --Unify 0 --VerifyOutput 0 --zopfliIterations 5000 --LogFile "D:\AutoHotkey Scripts\Alexander12 BAM\Log.txt" --OutPath "D:\AutoHotkey Scripts\Alexander12 BAM" "D:\AutoHotkey Scripts\Alexander12 BAM\CloakB_Sequence_0000_Frame_0000.bmp"
del CloakB_Sequence_0000_Frame_0000.bmp CloakB_Sequence_0001_Frame_0000.bmp


REM Hybrid item icon, no transparency, with shadow.
magick.exe convert original.png -background lime -alpha Background -fill lime -fuzz 25%% -opaque none -alpha off -trim CloakC.png
magick.exe convert CloakC.png -fill "#00FF00" -opaque "#000000" -trim -sample 60x60^> RemoveShadow.png
magick.exe convert RemoveShadow.png -fill "#000000" +opaque "#00FF00" -bordercolor "#00FF00" -border 4 Shadow.png
magick.exe convert RemoveShadow.png -transparent "#00FF00" RemoveShadow.png
magick.exe composite RemoveShadow.png Shadow.png NewWithShadow.bmp
magick.exe convert NewWithShadow.bmp -trim -type Palette -compress none BMP3:CloakC_Sequence_0000_Frame_0000.bmp
magick.exe convert CloakC.png -fill "#00FF00" -opaque "#000000" -trim -sample 64x64^> -background lime -type Palette -compress none BMP3:CloakC_Sequence_0000_Frame_0001.bmp
magick.exe convert CloakC.png -sample 32x32^> -trim -type Palette -compress none BMP3:CloakC_Sequence_0001_Frame_0000.bmp
del CloakC.png Shadow.png RemoveShadow.png NewWithShadow.bmp
"D:\Program Files\GitHub Projects\PS-BAM\PS BAM_x64.exe" --AdvancedFLTCompression 1 --AdvancedZlibCompress 2 --AllowShortPalette 1 --AlphaCutoff 10 --AutodetectPalettedBAM 1 --AutodetectPalettedThreshold 500 --BAMProfile "ItemIcon" --Compress 1 --DebugLevelL 1 --DebugLevelP 2 --DebugLevelS 1 --DropDuplicateFrameData 1 --DropDuplicateFrameEntries 1 --DropDuplicatePaletteEntries 1 --DropEmptyCycleEntries 1 --DropUnusedFrameData 1 --DropUnusedFrameEntries 1 --DropUnusedPaletteEntries 1 --ExportFrames "" --ExportFramesAsSequences 0 --ExportPalette "" --ExtraTrimBuffer 2 --ExtraTrimDepth 3 --FindBestRLEIndex 0 --FixPaletteColorErrors 1 --FLTSanityCutoff 720 --ForceShadowColor 2 --ForceTransColor 1 --IntelligentRLE 1 --ItemIcon2EE 1 --MaxRLERun 255 --OrderOfOperations PCE --ReduceFrameColumnLT 1 --ReduceFramePixelLT 1 --ReduceFrameRowLT 1 --ReplacePalette "" --ReplacePaletteMethod Quant --Rotate 0 --Save "BAM" --SearchTransColor 1 --SetXOffset "" --SetYOffset "" --SingleGIF 0 --TrimFrameData 1 --Unify 0 --VerifyOutput 0 --zopfliIterations 5000 --LogFile "D:\AutoHotkey Scripts\Alexander12 BAM\Log.txt" --OutPath "D:\AutoHotkey Scripts\Alexander12 BAM" "D:\AutoHotkey Scripts\Alexander12 BAM\CloakC_Sequence_0000_Frame_0000.bmp"
del CloakC_Sequence_0000_Frame_0000.bmp CloakC_Sequence_0000_Frame_0001.bmp CloakC_Sequence_0001_Frame_0000.bmp


Pause

The ImageMagick portions may look complicated, but most of it is just for Creating Shadows for Large Item Icons.  The PS BAM switches are mostly just to enable advanced compression.  The special ones to note in these cases are --BAMProfile "Zero", --BAMProfile "ItemIcon", and --ItemIcon2EE 1.  It creates three different BAMs for you to try, with the only input being your "Original.png".  Not a single pixel needs to be edited manually.  CloakA.bam is an EE-only single frame item icon with transparency, but it does not include a shadow.  One could certainly be added, and the process would be similar to the next two examples.  (You can remove "-sample 64x64^>" from the second line to keep the original size, although it will be bigger than other cloaks in the game.) CloakB.bam offers the best compatibility with both EE and classic games, has no transparency in the palette, and includes the shadow on the large icon.  CloakC.bam is a hybrid of the two, including a shadow and no transparency, but the "small" icon with no shadow is as large as what is normally displayed in the EEs.  Attached are the three BAMs.  Compare mine to the ones you made and let me know what you think.  I'll try to answer any questions.

PS_Cloak3.png.a59ab995e3dccb00ef919b4dd8645227.png

Alexander12 BAM.rar

Link to comment
17 hours ago, Sam. said:

The ImageMagick portions may look complicated, but most of it is just for Creating Shadows for Large Item Icons.  The PS BAM switches are mostly just to enable advanced compression.  The special ones to note in these cases are --BAMProfile "Zero", --BAMProfile "ItemIcon", and --ItemIcon2EE 1.  It creates three different BAMs for you to try, with the only input being your "Original.png".  Not a single pixel needs to be edited manually.  CloakA.bam is an EE-only single frame item icon with transparency, but it does not include a shadow.  One could certainly be added, and the process would be similar to the next two examples.  (You can remove "-sample 64x64^>" from the second line to keep the original size, although it will be bigger than other cloaks in the game.) CloakB.bam offers the best compatibility with both EE and classic games, has no transparency in the palette, and includes the shadow on the large icon.  CloakC.bam is a hybrid of the two, including a shadow and no transparency, but the "small" icon with no shadow is as large as what is normally displayed in the EEs.  Attached are the three BAMs.  Compare mine to the ones you made and let me know what you think.  I'll try to answer any questions.

PS_Cloak3.png.a59ab995e3dccb00ef919b4dd8645227.png

Alexander12 BAM.rar 10.93 kB · 2 downloads

Thank you very much, for you advices and help. I will compare and check these BAMS, but according to your screen, everything is perfect. I have downloaded them. But first i'd like to find out what is going wrong with DLCP.

Link to comment
5 minutes ago, Alexander12 said:

But first i'd like to find out what is going wrong with DLCP.

Well, one thing going wrong is that you are talking about non-sense, as the moding tool is called DragonLance TotalConversion Editor Pro, aka DLTCEP.

Link to comment
On 8/11/2020 at 5:17 AM, Sam. said:

To do this in DLTCEP, you'll want to go to Tools->Uncompress all, then Palette->Edit Palette.  Next, find the index of your background color.  In your case it is Color # 107 which is RGB(0,254,0).  Note that it SHOULD HAVE BEEN RGB(0,255,0).  Go ahead and correct that now.  Then enter that number into the "Transparent index" box:

PS_DLTCEP1.png.4727d7418a2d960d4d31f179a4e69f75.png

Then go to Palette->Order Palette.

 

It varies, see above for steps to do it in DLTCEP (setting transparent index and ordering palette). 

_____

Thank you, this is truly a revelation for me. I didn't know it. I did it, but there is still green edge on your screen here and here too, in another example, this is a description icon  of another item, but the matter is the same:

24956bcdc75c.png

I edited one green color, but what should be done with other green colours? In this way i had to edit all of them to 0-255-0? DLTCEP doesn't allow to change them to 0-255-0. And they are not 0-254-0, for example this one is 11-233-05. The base colour of background was 0-255-0 here. I understand, that you advice another method, but i'd like to try and finish with this one first, if possible.

 

Edited by Alexander12
Link to comment
11 minutes ago, Jarno Mikkola said:

Well, one thing going wrong is that you are talking about non-sense, as the moding tool is called DragonLance TotalConversion Editor Pro, aka DLTCEP.

Thanks for remark, i hope this can be forgiven, as i am not a native english speaker.

Edited by Alexander12
Link to comment
22 hours ago, temnix said:

Initiate the transvocational coolant protocol, amplify delta to the nth velocity and depropagate the nunchaki-dependant hydrovotaticon. 🙄

Just start making these images big, draw them big or blow them up to 500% so that you can use Paint's brushes for shading without having to squint at pixels. Use broad strokes, then run a black watercolor brush around the ages to tint them down, finally fill the background with black, exit and resize the image. The black will blend by itself with the nearest colors naturally, and pure black will remain for transparency. Paint isn't a perfect painting tool for sure, but it's the simplest. The only effects I haven't managed there was if I wanted a gradual change of lighting across an image. For that I import the images to ArtRage.

Thanks for an idea, i'll keep it in mind

Edited by Alexander12
Link to comment
On 8/11/2020 at 5:48 AM, Bartimaeus said:

When downscaling to an icon, I like to:

  1. Downscale using nearest neighbor to create a clean outline.
  2. Create a duplicate downscale using bicubic sharper instead.
  3. Create a third non-sharp bicubic downscale and do a 25% paste over the sharp version because bicubic sharper is good at getting the details, but is usually just a little bit too sharp for pleasant viewing (...and this method creates a better result than trying to do like gaussian blur after the fact or something).
  4. Paste the contents of the bicubic downscale inside of the nearest neighbor outline (selecting only pixels that are occupied, ignoring transparent or green pixels in order to still have a clean outline with no pesky green anti-aliasing artifacts).
  5. Tweak the outline as necessary - there may be a few pixels where there shouldn't be anything, or maybe there's a few pixels that are transparent/green that shouldn't be, fill/remove them as necessary.

Thanks for advice

Link to comment
22 hours ago, temnix said:

Initiate the transvocational coolant protocol, amplify delta to the nth velocity and depropagate the nunchaki-dependant hydrovotaticon. 🙄

I'm pretty sure you forgot to mention the Turbo Encabulator:

 

Link to comment

Join the conversation

You are posting as a guest. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...