Age | Commit message (Collapse) | Author |
|
Mostly division. Also cleaned up a couple uses of bare open().
|
|
Mostly xrange (screw it, just use range), spurious tabs, and division.
|
|
|
|
PNG files were opened as text files, thus the signature 0x0D 0x0A bytes were swallowed depending on OS.
Signed-off-by: Tauwasser <tauwasser@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Fixes aec2e7ff.
|
|
remove yaml
undoes parts of 0182bcaf8f92e66396c17969b0753f2175603ccd
|
|
|
|
|
|
Conflicts:
pokemontools/gfx.py
|
|
|
|
This is a little closer to the target compressor than before.
|
|
|
|
|
|
|
|
Keys count both as path nodes and attributes depending on context.
An example gfx.yaml:
```
gfx:
pics:
pal_file: normal.pal
pic_dimensions: yes
animate: yes
stupid_bitmask_hack: [dewgong, lugia]
pc:
literal_only: yes
```
Here, all graphics matching gfx/pics/.../*.png will use palette gfx/pics/.../normal.pal and be interpreted as animated pics. gfx/pc.2bpp will compress using only the `literal` command.
If gfx.yaml doesn't exist, current behavior is unchanged. Filename arguments override yaml.
|
|
|
|
"whoops"
|
|
Truncate colors in a palette beyond the limit of 4.
Make palette sorting more accurate by taking the sum of the hues rather than by luminance. Ultimately, palette order is up to the whim of whoever was drawing in the tile editor at the time, but this is a reasonable estimation.
|
|
Speed, readability, accuracy and compression are all improved.
Also fix an off-by-one error in repeat commands in the compressor.
|
|
Nothing needs this yet, but chances are it'll happen.
|
|
Conflicts:
pokemontools/gfx.py
|
|
|
|
|
|
|
|
Transposing non-square images would work over the expected width, rather than the current width (the expected height). This never came up since transposed images are typically square.
|
|
This prevented pokered from building if the file "baserom.gbc" did not exist.
|
|
Before, converting a .2bpp.lz file required calling decompress and convert_to_png
on the compressed and decompressed files respectively.
gfx.py unlz {}.lz
gfx.py png {}
Putting a .lz file into convert_to_png would raise an exception.
Instead, passing compressed graphics into convert_to_png will decompress them first.
This skips the (now optional) manual decompress step.
|
|
This allows transposed images to be grouped together (e.g. animations).
|
|
Also fix a bug where images smaller than a tile are not converted at all.
|
|
Eliminates repeated tiles and also spits out a tilemap respectively.
One-way for now. Likely to be used in pokered, but useful in its own right.
|
|
- Use argparse and less redundant commands.
- Make .lz independent of content. Allows tilemaps to not be images.
- Add .[w]x[h] filename argument for transposed images.
- Add .interleave filename argument for 8x16 sprites.
- Refactor some conversion code.
|
|
Some images do not occupy a full tile.
In pokered, gfx/minimize_pic.1bpp is 8x5. This is still rectangular.
Previously, converting this image would cause an error.
|
|
png has some incompatibilities with 2bpp. Among them:
- 2bpp is tiled, and can be arranged arbitrarily
- 2bpp does not have associated palette data
- png must be rectangular
- png must have specific dimensions
The requirements for an image vary, and are unwritten. One conversion method will not work for all images.
To resolve these conflicts metadata can be attached to images and related data.
So as to not create additional files without changing the file content, the filename is used.
Usage: metadata is defined as pseudoextensions.
.w<width>
- force width to <width> px
.h<height>
- force height to <height> px
.t<num>
- pad the image by <num> tiles so the resulting png can be rectangular
- remove said tiles when converting back to 2bpp
Example:
gfx/title/logo.w160.t4.{lz,2bpp,png}
- width 160px
- pad by 4 tiles
|
|
|
|
|
|
simpler to edit by hand than bin dumps
|
|
Remove globals from the map editor
|
|
|
|
|
|
|
|
|
|
|
|
also dont assume any dimension matches in png conversion
|
|
|