Skip to content
This repository has been archived by the owner on Jan 21, 2023. It is now read-only.

Bottom-right glitch in sprites. (Bug) #1015

Open
RiffyDiffy opened this issue Jul 1, 2022 · 5 comments
Open

Bottom-right glitch in sprites. (Bug) #1015

RiffyDiffy opened this issue Jul 1, 2022 · 5 comments

Comments

@RiffyDiffy
Copy link

RiffyDiffy commented Jul 1, 2022

Hi, RiffyDiffy, here!
So, I'm ripping some stuff from the Cuphead DLC, and trust me, I got this problem before (When trying to rip some cutscene sprites from Cookie Run: Kingdom.).
See, the anteater's sprites has this weird glitch in the bottom-right corner, and I absolutely have no idea what is causing it.
AssetStudioGUI_ELs7TPzPBF
If you can provide a fix to this, that would make me happy. Thanks for reading this!

@RandomTBush
Copy link

If it helps isolate the issue here, apparently this glitch was introduced sometime between v0.16.8 and v0.16.21 (the first version with this issue). So for now, rollback to v0.16.8 until it's fixed.

@RandomTBush
Copy link

Apparently this issue's been around since this Dec. 3 commit: e501940 . The lines of code highlighted below seem to have unintentionally created this problem, and a test compile I did changing those lines back to their previous commit revision's seemingly fixed the issue.

e501940#diff-5c38f3d6e5d1adc64f2144ccaef1dfd54e903a302a0ae07a2b18ea5fe3c55458R103-R110

@RandomTBush
Copy link

Addendum: Apparently v0.16.0 and v0.16.8 also have a different kind of issue where some sprites have vertical lines slicing through them instead (which v0.16.21 at least fixed, despite causing the alternate glitch above), so v0.15.47 appears to be the last version before these sprite glitches started showing up.

@RandomTBush
Copy link

Looks like I found a proper fix for this issue!

In line 98 of SpriteHelper.cs: https://github.com/Perfare/AssetStudio/blob/master/AssetStudioUtility/SpriteHelper.cs#L98

The following line needs to be changed from
mask.Mutate(x => x.Fill(options, SixLabors.ImageSharp.Color.Red, path));
to something like:
mask.Mutate(x => x.Fill(options, SixLabors.ImageSharp.Color.Red, path).Draw(options, Pens.Solid(SixLabors.ImageSharp.Color.Red, 3), path));

The issue stems from the fact that the cutout mask doesn't have any outlines drawn along it (something that is more visible if you change the "antialias" option a few lines above to "true", so adding a three-pixel border around the mask's triangles seems to remove the holes.

RandomTBush added a commit to RandomTBush/AssetStudio that referenced this issue Jan 18, 2023
Made a small adjustment to the "SpriteHelper" function. With it, sprites will now have their correct animation offsets instead of being cropped, and a glitch involving being cut correctly has been addressed (issue Perfare#1015 reported by RiffyDiffy in the original AssetStudio repository, where gaps can be seen in certain "Tight" packed sprites (due to the cutout mask's triangles lacking an outline).
RandomTBush added a commit to RandomTBush/AssetStudio that referenced this issue Jan 18, 2023
Made a small adjustment to the "SpriteHelper" function. With it, sprites will now have their correct animation offsets instead of being cropped, and a glitch involving being cut correctly has been addressed (issue Perfare#1015 reported by RiffyDiffy), where gaps can be seen in certain "Tight" packed sprites (due to the cutout mask's triangles lacking an outline).
RandomTBush added a commit to RandomTBush/AssetStudio that referenced this issue Jan 18, 2023
Made a small adjustment to the "SpriteHelper" function. With it, sprites will now have their correct animation offsets instead of being cropped, and a glitch involving sprites not being cut correctly has been addressed (issue Perfare#1015 reported by RiffyDiffy), where gaps can be seen in certain "Tight" packed sprites (due to the cutout mask's triangles lacking an outline).
@RandomTBush
Copy link

Went and made a fork which has the fixes applied to it. Don't mind the repeated messages, I made mistakes as I tend to do when I'm working on things at 4AM.

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

No branches or pull requests

2 participants