putpng

Crates.ioputpng
lib.rsputpng
version1.0.1
created_at2025-06-12 17:19:44.511012+00
updated_at2025-06-14 00:23:21.516616+00
descriptionReplacement for the doom modding tools grabpng and setpng
homepagehttps://github.com/wojo81/putpng
repositoryhttps://github.com/wojo81/putpng
max_upload_size
id1710012
size65,033
(wojo81)

documentation

https://docs.rs/putpng

README

putpng

Purpose

putpng is a sort of replacement for the Doom modding tools setpng and grabpng: https://zdoom.org/wiki/SetPNG

This program is only meant for offsetting with 'grAb' chunks within 'png' files, so it does not contain equivalents to setpng's 'alph', 'noalph', and 'z' options. However, it does contain a crop command which is present in other Doom modding tools.

Usage

grab command: applies an offset to specified images by inserting or modifying a 'grAb' chunk.

putpng grab <x> <y> <file_path(s)>


crop command: crop the empty edges out of the specified images and change the offsets of the images to match the relative positions of the original images (Note: the crop is destructive, so any chunks that are considered unnecessary will be removed)

putpng crop <file_path(s)>


show command: show the offsets of the specified images

putpng show <file_path(s)>


ignore option: optional argument that ignores any of the paths that contain any of the specified strings

putpng <command> <file_path(s)> [-i | --ignore] <string(s)>


help: provides help

putpng [-h | --help | help]

version: provides version

putpng [-V | --version]

Example

Let's say that a user wants to apply an offset of '(16, 32)' and crop a batch of sprites under various folders under the parent folder 'generic_weapon'. However, the folders named 'pickup' and 'projectile' need all of their underlying sprites to be centered. In this case they could open a terminal within the parent folder of 'generic_weapon' and write:

putpng grab 16 32 generic_weapon\*\* -i pickup\ projectile\
putpng grab w/2 'h / 2' generic_weapon\pickup\* generic_weapon\projectile\*
putpng crop generic_weapon\*\*

License

This project is licensed under either of

Commit count: 26

cargo fmt