Skip to content

Python script which reducing amount of unique tiles in image (useful for retro development)

Notifications You must be signed in to change notification settings

bolon667/removeUniqueTilesFromImage

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 

Repository files navigation

Unique Tile Remover

Unique Tile Remover logo

Python script which reducing amount of unique tiles in image (useful for retro development)

Comparison

Click to see full picture Compare

How to use

  1. Download python script
  2. Put your image in script folder, and rename it to map.png
  3. Change quality in python script of reducer.reduceTilesetSizeBySimilarity(0.3) for your needs (value from 0.2 to 1.0)
  4. Run script, result will be in result.png file, in script folder

How it works

  1. Generating tileset from image
  2. Generating tilemap from image (2D array)
  3. Generating reduced tileset according to this formula: tile_size = cell_size*quality
  4. Comparing every tile with every tile in reduced tileset, if tiles are equal, then merging tiles. Merged tile putting from reduced tileset to original tileset
  5. Recreating image back, from tileset and tilemap.
  6. Done

About

Python script which reducing amount of unique tiles in image (useful for retro development)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages