Skip to content

Icons optimization#278

Merged
Kyome22 merged 12 commits into
mainfrom
icons-opt
Jan 29, 2026
Merged

Icons optimization#278
Kyome22 merged 12 commits into
mainfrom
icons-opt

Conversation

@mor39a
Copy link
Copy Markdown
Collaborator

@mor39a mor39a commented Jan 26, 2026

Context of Contribution

  • Bug Fix
  • Refactoring
  • New Feature
  • Others

Summary of the Proposal

Memory usage was reduced in files with the same icon in different colors by creating a function that modifies the color at compile time.

Reason for the new feature

It reduces the amount of unnecessary resource usage in terms of file size.
Commented on #260

Checklist

  • This PR does not contain commits of multiple contexts.
  • Code follows proper indentation and naming conventions.
  • Implemented using only APIs that can be submitted to the Microsoft Store.
  • Works correctly in both dark theme and light theme.
  • Works correctly on any device.

@mor39a mor39a requested a review from Kyome22 January 26, 2026 05:57
Comment thread RunCat365/Theme.cs Outdated
Comment thread RunCat365/ContextMenuManager.cs Outdated
Comment thread RunCat365/IconColor.cs Outdated
Comment thread RunCat365/EndlessGameForm.cs
Comment thread RunCat365/IconColor.cs Outdated
Comment thread RunCat365/IconRecolorizer.cs
@Kyome22
Copy link
Copy Markdown
Collaborator

Kyome22 commented Jan 26, 2026

@mor39a Thank you for creating the PR so quickly. I've left some review comments, so I'd appreciate it if you could take a look.

@mor39a mor39a requested a review from Kyome22 January 27, 2026 10:24
@Kyome22
Copy link
Copy Markdown
Collaborator

Kyome22 commented Jan 28, 2026

@mor39a
The visual quality dropped considerably after switching the new system's color from black to white. Since this is not release-ready, I want to find a better inversion algorithm that maintains quality.

Before
Image

After
Image

It seems like it would work if we could just change the RGB values from 0 to 255 while keeping the alpha value as is.

Screenshot 2026-01-28 at 17 23 07 Screenshot 2026-01-28 at 17 22 54

@Kyome22
Copy link
Copy Markdown
Collaborator

Kyome22 commented Jan 28, 2026

Oh! I've discovered that there's an issue with the ico resources themselves.
Since the Parrot resource seems fine, we'll likely need to recreate the other two to match it.
It might be better to handle that task in a separate branch first.

Runner Format
Cat Traditional BMP-based ICO
Horse PNG-embedded ICO (non-square: 32x27)
Parrot PNG-embedded ICO

@Kyome22
Copy link
Copy Markdown
Collaborator

Kyome22 commented Jan 28, 2026

Nooo. The decisive difference wasn't a matter of format. Parrot didn't use alpha-based anti-aliasing. The issue was only surfacing with Cat and Horse because they use anti-aliasing.

Screenshot 2026-01-28 at 18 32 31 Screenshot 2026-01-28 at 18 32 24 Screenshot 2026-01-28 at 18 32 38

@Kyome22
Copy link
Copy Markdown
Collaborator

Kyome22 commented Jan 28, 2026

I'm going to try creating Icon instances using PNGs instead of ICOs on my end.

@mor39a
Copy link
Copy Markdown
Collaborator Author

mor39a commented Jan 28, 2026

It seems like it would work if we could just change the RGB values from 0 to 255 while keeping the alpha value as is.

That's currently the case; I only modify the RGB values ​​and leave the alpha channel intact.

@Kyome22
Copy link
Copy Markdown
Collaborator

Kyome22 commented Jan 28, 2026

@mor39a Thank you for waiting.
I've created a PR based on this branch to resolve the image degradation issue. → #279
Please take a look and check the behavior.

Resolve the visual degradation issue when inverting the runner's colors.
Copy link
Copy Markdown
Collaborator

@Kyome22 Kyome22 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM
There are some unnecessary diffs, but they were caused by Visual Studio's auto-generation, so let's just leave them as they are.

@Kyome22 Kyome22 merged commit 16c9603 into main Jan 29, 2026
@Kyome22 Kyome22 deleted the icons-opt branch January 29, 2026 02:04
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

Successfully merging this pull request may close these issues.

2 participants