Problem: editing PNG files misaligns them

Ask about editing graphics, sounds, models, music, etc here!
Shaders (GLSL) and SNDINFO questions also go here!

Moderators: GZDoom Developers, Raze Developers

Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. If you still don't understand how to use a feature, then ask here.
GrayFace
Posts: 24
Joined: Mon Feb 13, 2023 1:34 am
Preferred Pronouns: He/Him
Operating System Version (Optional): Windows 7 x64
Graphics Processor: ATI/AMD with Vulkan/Metal Support

Problem: editing PNG files misaligns them

Post by GrayFace »

I'm trying to fix a weapon from Project Brutality, but it gets misaligned.
Original file: https://www.dropbox.com/s/3x7p3meq1thhh ... 0.png?dl=1
Same file opened and saved bu GIMP: https://www.dropbox.com/s/z55dcwpaddep5 ... 0.png?dl=1
They look the same in any viewer, but in game the edited one is misaligned.
When viewing metadata with "ImageMagick\identify.exe -verbose" I see difference in "minimum-bounding-box" values, but no tool that's supposed to copy metadata between images seems to copy these values.
GrayFace
Posts: 24
Joined: Mon Feb 13, 2023 1:34 am
Preferred Pronouns: He/Him
Operating System Version (Optional): Windows 7 x64
Graphics Processor: ATI/AMD with Vulkan/Metal Support

Re: Problem: editing PNG files misaligns them

Post by GrayFace »

I see SetPNG and grabpng can be used to set it, but the only way to get these values I see is through grabpng GUI, while I need a command line tool to extract them from original files and then apply to modified files after each edit...
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49130
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Problem: editing PNG files misaligns them

Post by Graf Zahl »

If you need a GUI for setting sprite offsets, the best recommendation is SLADE.
General image tools do not know about the Doom specific offset.
GrayFace
Posts: 24
Joined: Mon Feb 13, 2023 1:34 am
Preferred Pronouns: He/Him
Operating System Version (Optional): Windows 7 x64
Graphics Processor: ATI/AMD with Vulkan/Metal Support

Re: Problem: editing PNG files misaligns them

Post by GrayFace »

Graf Zahl wrote:
> If you need a GUI for setting sprite offsets, the best recommendation is
> SLADE.
> General image tools do not know about the Doom specific offset.

I needed the exact opposite. In order to quickly reapply grAB to image you need a .bat file, not GUI. I needed a program that would create such .bat files by extracting grAB information.
I actually created it and now I'm thinking of best interface for it:
Now I'm creating a grAB.bat that sets coordinates for all images in a folder (those that have them set up) and placing it into that folder. Problem is, then these BAT files would probably end up in PK3 archives. Plus, there are many mods with extension-less images, so should I pick them up by default or only *.png by default?
Last edited by GrayFace on Tue Feb 21, 2023 2:25 am, edited 1 time in total.

Return to “Assets (and other stuff)”