Skip to content

Fix blurry preview when opening icon files with frames ordered from small to large#54

Merged
TheJoeFin merged 5 commits intodevfrom
copilot/fix-preview-image-blurriness
Oct 24, 2025
Merged

Fix blurry preview when opening icon files with frames ordered from small to large#54
TheJoeFin merged 5 commits intodevfrom
copilot/fix-preview-image-blurriness

Conversation

Copy link
Contributor

Copilot AI commented Oct 23, 2025

Fix blurry preview when opening icon files with frames ordered from small to large

  • Explore repository structure and understand the issue
  • Modify LoadFromImagePath in MainPage.xaml.cs to select the largest frame when loading .ico files
  • Use NearestNeighbor interpolation for images smaller than 512px to maintain sharp pixels
  • Run CodeQL security check
  • Review and verify the fix addresses the issue
  • Merge with dev branch

Summary of Changes

Modified MainPage.xaml.cs in the LoadFromImagePath() method:

  1. Select largest frame from .ico files: Instead of loading the first frame (which may be the smallest if ordered small-to-large), the code now:

    • Loads all frames into a MagickImageCollection
    • Finds the frame with the largest area (width × height)
    • Uses that frame for the MainImage preview
  2. Sharp pixel rendering for small images: When the loaded image is smaller than 512px:

    • Upscales it to 512px using Point filter (NearestNeighbor interpolation)
    • This maintains sharp, crisp pixels instead of blurry bilinear interpolation
    • Particularly important for pixel art and small icon images

These minimal changes ensure that icon files display at their best quality, using the largest available resolution and maintaining sharp pixels for small images.

Original prompt

This section details on the original issue you should resolve

<issue_title>When opening an icon file ordered from small to large the smaller image gets used in the preview making it blurry</issue_title>
<issue_description>The largest possible size should be used as the MainImage to reduce the chance for blurry images. If the image is smaller than 512, use the same PreviewImage to display the image with sharp pixels </issue_description>

Comments on the Issue (you are @copilot in this section)

Fixes #43


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 2 commits October 23, 2025 23:20
Co-authored-by: TheJoeFin <7809853+TheJoeFin@users.noreply.github.com>
Co-authored-by: TheJoeFin <7809853+TheJoeFin@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix preview image blurriness for small icons Fix blurry preview when opening icon files with frames ordered from small to large Oct 23, 2025
Copilot AI requested a review from TheJoeFin October 23, 2025 23:23
@TheJoeFin TheJoeFin changed the base branch from main to dev October 24, 2025 02:43
@TheJoeFin
Copy link
Owner

@copilot rebase from dev

Copy link
Contributor Author

Copilot AI commented Oct 24, 2025

@copilot rebase from dev

Merged dev branch into this PR in commit d6c0ec7. The merge was successful with no conflicts.

@TheJoeFin TheJoeFin marked this pull request as ready for review October 24, 2025 03:55
@TheJoeFin TheJoeFin merged commit d01665c into dev Oct 24, 2025
@TheJoeFin TheJoeFin deleted the copilot/fix-preview-image-blurriness branch October 24, 2025 03:57
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.

When opening an icon file ordered from small to large the smaller image gets used in the preview making it blurry

2 participants