Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Filter out blank alpha tiles #7

Open
lajohnston opened this issue Mar 8, 2023 · 2 comments
Open

Filter out blank alpha tiles #7

lajohnston opened this issue Mar 8, 2023 · 2 comments

Comments

@lajohnston
Copy link

Hi there,

Thanks for this tool, it's really helping with my Aseprite => Tiled workflow for SMS game development :)

I'm wondering whether it would be possible/desirable to filter out blank 'alpha' tiles from the outputted data, i.e. tiles that don't contain any RGB pixels, which may occur in a source image that has some blank space in it. As an example, my current workflow is to construct tiled background objects in Aseprite, export full images of them, then use png2tile to convert them into a TMX tilemap. The result is de-duped tilesets (with h/v flip awareness) plus the constructed representations of these objects in the TMX that I can paste into my Tiled level tilemap, without having to reassemble the pieces like a jigsaw.

This is working fine so far, but one problem I'm having is that because the source images are full images rather than compacted tilesets they do have some blank transparent space in places, and this results in a junk blank tile being added to each tileset that is filled with palette index 0. The particular graphics I'm creating are isometric and I can't really compact them together to get rid of this space.

Would it be possible for these alpha tiles to be filtered out from the tileset completely, either by default or as an option? The resulting TMX tilemap could then use tile id 0 in place of these, which I believe is Tiled's way of representing non/transparent tiles in a tilemap layer.

Thanks!

@yuv422
Copy link
Owner

yuv422 commented Mar 9, 2023

Hi, yes I can see how this would be useful. I'll take a look at adding it in for you. :)

@lajohnston
Copy link
Author

great, thanks 🙂 Just a related thing regarding blank tiles if you get a chance to look at this, it seems the tileset PNG files (*.tmx.png) currently get padded with blank tiles to the nearest 16-tiles (so 1 tile becomes 16, 17 tiles become 32). The actual binary data doesn't contain these blanks so that's fine, but the extra tiles mean it's not possible in the custom Tiled exporter I'm writing to determine how many actual tiles there are within each tileset and how can they can fit together. As a workaround I can manually crop those images but it's just an FYI in case this fix also resolves this 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants