• Hello [name]! Thanks for joining the GMC. Before making any posts in the Tech Support forum, can we suggest you read the forum rules? These are simple guidelines that we ask you to follow so that you can get the best help possible for your issue.

Question - IDE trimming sprite?

C

c3pu

Guest
In gms1 there was an option to trim sprites automatically. Is this no longer doable or am i just not seeing the option?
 
@c3pu In the sprite window you can click on the icon in the Size: section and do a resize of the canvas there. That seems to affect all the images in the sprite.
upload_2016-12-7_18-36-59.png upload_2016-12-7_18-37-27.png
 

Mike

nobody important
GMC Elder
This is something that has been requested and we'll look to add back in. Currently you can select an area then select "Crop all frames to selection".

I will say however, GameMaker Studio 1.x and 2 have always auto-cropped on export, so you're not wasting anyspace if you don't trim
 

chance

predictably random
Forum Staff
Moderator
This is something that has been requested and we'll look to add back in. Currently you can select an area then select "Crop all frames to selection".
Glad to hear that. That old "auto-crop" feature was especially useful with animated sprites, where each frame might have a different image size. It would automatically adjust the crop size to account for the frame with the largest image.

Of course, the "crop to selection" does the same thing. But the user has to find the largest frame himself, and then position the selection box perfectly. So I miss that old feature.
 
C

c3pu

Guest
Glad to hear that. That old "auto-crop" feature was especially useful with animated sprites, where each frame might have a different image size. It would automatically adjust the crop size to account for the frame with the largest image.

Of course, the "crop to selection" does the same thing. But the user has to find the largest frame himself, and then position the selection box perfectly. So I miss that old feature.
Thats why i used it as well, fortunate i just found out that aseprite has the feature as well but i have to think of it before exporting.
 

MilesThatch

Member
Definitely was looking for this option. Extremely useful for animated sprites as it will crop the image to the smallest possible size while taking into account all the animated frames.

Good thing you fellas are planning on adding it.
 

gnysek

Member
What's more, if you got exactly 100% identical sprite frames in different sprites, they were exported as one for texture pages (not sure, probably checksum is made on each sprite frames). In GM:S 1.x that may be helpful, as you can have same sprite and background, and have them as one sprite on texture atlas page (but they always need to be 100% pixel identical).
 
C

c3pu

Guest
What's more, if you got exactly 100% identical sprite frames in different sprites, they were exported as one for texture pages (not sure, probably checksum is made on each sprite frames). In GM:S 1.x that may be helpful, as you can have same sprite and background, and have them as one sprite on texture atlas page (but they always need to be 100% pixel identical).
Just to be sure i got this right if two different sprite have identical frame in them they will only appear once on the tpage?
 
Last edited by a moderator:

MilesThatch

Member
Just wanted to add that when trying to select assets in the room editor, the sprites with extra empty space get accidentally selected. This is also another reason why the pixel perfect image crop feature was extremely useful. Found this out just now when building levels with multiple clustered assets in one layer near each other, having trouble selecting the right one.
 
C

c3pu

Guest
Just wanted to add that when trying to select assets in the room editor, the sprites with extra empty space get accidentally selected. This is also another reason why the pixel perfect image crop feature was extremely useful. Found this out just now when building levels with multiple clustered assets in one layer near each other, having trouble selecting the right one.
very good point
 

MilesThatch

Member
I'm literally importing sprites to 1.4 blank project right now just to use the crop tool lol

EDIT: before I remembered that I can just import sprites to photoshop and crop image to selection -_-
 
Last edited:
C

c3pu

Guest
I'm literally importing sprites to 1.4 blank project right now just to use the crop tool lol

know any standalone auto cropping tools out there?
hahaha i did that to the first few days.
Unfortunately no, i make my sprites in aseprite and i found out that it as that functionality under the sprite tab.
1.1.6 was still free and relatively easy to find. not sure if i'm allowed to share it though. PM me if you need me NOT to share it ;-).
What software do you use to make your sprites?

edit:1.8 was the last version that was "free"(by compiling the source code)
 
Last edited by a moderator:

MilesThatch

Member
Current project asks for a certain image style so I use Flash for designing game content BUT I export as raster graphics.

PS: I just realized how to crop images faster.
in Photoshop you are able to define multiple shortcuts to the same function without overwriting default ones.
So I defined 3 additional shortcuts
F1 - Invert Selection
F2 - Crop Selection
F3 - Save Image

so now cropping is a matter of selecting the empty space and quickly pressing the three F keys, pretty speedy process
 

Mike

nobody important
GMC Elder
I'm literally importing sprites to 1.4 blank project right now just to use the crop tool lol
EDIT: before I remembered that I can just import sprites to photoshop and crop image to selection -_-
But theres a crop to selection in GMS2.....?!?!?

On top of this, you can make a selection, flip through the frames, using CTRL add to the selection if you need to - then crop to it.
 
@

@Alex@

Guest
But theres a crop to selection in GMS2.....?!?!?

On top of this, you can make a selection, flip through the frames, using CTRL add to the selection if you need to - then crop to it.
Cropping to selection is a lot more cumbersome than cropping to the box of the sprite that's actually used.
 

MilesThatch

Member
But theres a crop to selection in GMS2.....?!?!?

On top of this, you can make a selection, flip through the frames, using CTRL add to the selection if you need to - then crop to it.
What @Alex@ said. In 1.4, it's as quick as pressing ctrl+shift+P, leaving the crop value at 0 and pressing enter and it will auto-crop all the frames of the sprite to pixel perfect precision.

Yes the manual crop is there in 2.0 and yes you can indeed cycle through all the frames and adjust the crop to that, but I have folders upon folders of graphical content. 1,4 auto-crop is effectively many times more streamlined. Manual crop is useful still 1.4 didn't have manual crop to selection but it's not very suitable for processing large quantities of graphical content like you would on a properly organized project. That Photoshop solution shaved off loads of time.
 

Nocturne

Friendly Tyrant
Forum Staff
Admin
PS: I just realized how to crop images faster.
in Photoshop you are able to define multiple shortcuts to the same function without overwriting default ones.
So I defined 3 additional shortcuts
F1 - Invert Selection
F2 - Crop Selection
F3 - Save Image
Can't you record an Action for that? Then it's just Import > Run action > Done! :)
 

MilesThatch

Member
Can't you record an Action for that? Then it's just Import > Run action > Done! :)
Perhaps. Only issue is that a part of the process is to use a wand and click on empty space and it's not guaranteed that all the sprites will have emptiness in the same spot. Maybe if I used "select by color" instead of the wand and set it to select alpha, it might just do.

Would certainly be nice to batch process this stuff...
 

MilesThatch

Member
Why were basic features removed from the sprite editor, anyway? You guys already them in 1.x, haha! X'D
GMS2.0 was programmed from scratch (with a few exceptions of core mechanics). It's not that they removed features, it's that they haven't programmed them in yet. We are still in Beta after all.
 
GMS2.0 was programmed from scratch (with a few exceptions of core mechanics). It's not that they removed features, it's that they haven't programmed them in yet. We are still in Beta after all.
Their answers seem to indicate that certain features won't make it back in. I'd call those "removed," no matter what the technical reason is. And from what Yoyo staff have said on these forums since the beta launch, it seems to me that GMS2 isn't a complete rewrite, although I could be wrong on that. Pretty sure Mike has blamed the old code base for problems that have carried over to GMS2.
 

Mike

nobody important
GMC Elder
Trim has been in there since 2.0.6 via the image menu. You say I'd stated this in April 2016, GMS2 wasn't even out then. It was a comment from the beta in December It was added in May, not long after public release - where we obviously had lots of things to fix before releasing first.

Basically, please do not give excuses or another reason/method to go away around the whole main topic stating this is beta or alpha as game maker 2 is already more than a year in the market.
Perhaps look and see if you can find it first? check the release notes? While the online manual isn't always right up to date, the built in one should be, and it's listed in there.



From the releases notes:
Version 2.0.6.146 Download
Tue, 16 May 2017 16:39:27 Z

This is mainly a bug-fix release, with lots and lots of issues resolved across the entire product. However, we have also added Pinch and Rotate gesture events and the first few image editor tools: Trim, Reverse Frames, and Colour Remove.


Where to find it.
upload_2017-9-13_10-26-23.png
 
P

Papaman

Guest
Trim has been in there since 2.0.6 via the image menu. You say I'd stated this in April 2016, GMS2 wasn't even out then. It was a comment from the beta in December It was added in May, not long after public release - where we obviously had lots of things to fix before releasing first.


Perhaps look and see if you can find it first? check the release notes? While the online manual isn't always right up to date, the built in one should be, and it's listed in there.



From the releases notes:
Version 2.0.6.146 Download
Tue, 16 May 2017 16:39:27 Z

This is mainly a bug-fix release, with lots and lots of issues resolved across the entire product. However, we have also added Pinch and Rotate gesture events and the first few image editor tools: Trim, Reverse Frames, and Colour Remove.


Where to find it.
View attachment 12728

MY BAD mike. Took like 2 days to find the trim function. Tried to find in youtube and google. I failed. Found it a few minutes ago. Thanks for the heads up. Cheers!!
 
Top