[SOLVED] cropping sprites

Game development with Board Game Arena Studio
User avatar
apollo1001
Posts: 78
Joined: 21 July 2015, 10:41

[SOLVED] cropping sprites

Postby apollo1001 » 16 June 2018, 17:11

Hi All

I'm currently using a sprite of tiles which are a little large (essentially they have still got their bleed areas). I am able to use CSS to crop the outer 7px from around each tile without any issue, but I'm now wondering about using the Stock component to hold a selection of these tiles. To my knowledge the Stock component doesn't have any options to crop / offset / resize the images but simply carves up the sprite into the fixed size pieces.

So my question is: what is the easiest way to get my sprite file to work with the stock component? Currently the only way I can think of doing it is to crop each individual tile and rebuild the overall sprite. If anyone has used any clever sprite software or knows a way of setting this up with Stock then I'd welcome the advise!

For clarity all of my tile images are currently 7px too big in each direction and need cropping, not resizing.

Thanks
Apollo
Last edited by apollo1001 on 17 June 2018, 12:48, edited 1 time in total.

User avatar
Tchebychev
Posts: 127
Joined: 08 March 2014, 00:53

Re: cropping sprites

Postby Tchebychev » 16 June 2018, 21:17

Hi!

If you know the Python language, you can use the PIL library (Picture Image Library, Pillow in Python 3), to process your file programmatically:
https://pillow.readthedocs.io/en/5.1.x/
The idea is to loop on each card of your sprite, crop it and bundle them together again.
I think such utility exists in another language you'd like more.

Tcheby

User avatar
apollo1001
Posts: 78
Joined: 21 July 2015, 10:41

Re: cropping sprites

Postby apollo1001 » 17 June 2018, 12:47

Tchebychev wrote:process your file programmatically

Thank you Tcheby. Not sure why I hadn't thought of that in the first place! :lol:

User avatar
Tchebychev
Posts: 127
Joined: 08 March 2014, 00:53

Re: [SOLVED] cropping sprites

Postby Tchebychev » 17 June 2018, 17:51

My pleasure :)
Enjoy!

User avatar
Victoria_La
Posts: 308
Joined: 28 December 2015, 20:55

Re: [SOLVED] cropping sprites

Postby Victoria_La » 17 June 2018, 19:30

The imagemagic (command line image manipulation utils) have bunch of options of cropping/stitching/resizing/converting images.
I never had to do anything programmatically because it so reach. Do you have images before they got into sprite?


Return to “Developers”

Who is online

Users browsing this forum: No registered users and 3 guests