Skip to content

feat: (iOS) Apply trilinear filtering to smooth out missized images#368

Open
zarv1k wants to merge 2 commits into
dream-horizon-org:mainfrom
zarv1k:feature/ios-add-trilinear-filter
Open

feat: (iOS) Apply trilinear filtering to smooth out missized images#368
zarv1k wants to merge 2 commits into
dream-horizon-org:mainfrom
zarv1k:feature/ios-add-trilinear-filter

Conversation

@zarv1k

@zarv1k zarv1k commented Jan 23, 2026

Copy link
Copy Markdown

Summary:

This PR improves quality of missized images by applying a trilinear filter.

Changelog:

  • [IOS] [ADDED] - Apply trilinear filtering to smooth out missized images

Test Plan:

Use large image in smaller container view. Before update you can see that the straight lines are stepped, which is really noticeable. After this update image the straight lines on the image look much better as on screenshots below:

Before:
Screenshot 2026-01-23 at 14 23 53

After:
Screenshot 2026-01-23 at 14 33 04

@orca-security-in orca-security-in Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Orca Security Scan Summary

Status Check Issues by priority
Passed Passed Infrastructure as Code high 0   medium 0   low 0   info 0 View in Orca
Passed Passed SAST high 0   medium 0   low 0   info 0 View in Orca
Passed Passed Secrets high 0   medium 0   low 0   info 0 View in Orca
Passed Passed Vulnerabilities high 0   medium 0   low 0   info 0 View in Orca

@github-actions

Copy link
Copy Markdown

🚀 Thanks for your first Pull Request!
Your contribution is greatly appreciated, and a maintainer will review it soon.
Meanwhile, feel free to check out other issues or share your thoughts on the project.
We’re excited to have you on board! 🎉

@devanshsaini11

Copy link
Copy Markdown
Contributor

Hi @zarv1k
Thanks for raising this PR, have you tested trilinear filter for magnification i.e small images in larger containers. Trilinear filtering can sometimes make upscaled images appear slightly blurrier compared to the default bilinear filtering. It will be good to confirm there's no regression in that case.

@devanshsaini11 devanshsaini11 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Could you move the filtering lines outside the #if block?

@zarv1k

zarv1k commented Feb 2, 2026

Copy link
Copy Markdown
Author

Hi @zarv1k Thanks for raising this PR, have you tested trilinear filter for magnification i.e small images in larger containers. Trilinear filtering can sometimes make upscaled images appear slightly blurrier compared to the default bilinear filtering. It will be good to confirm there's no regression in that case.

Hi! TBH I haven't seen any problems with blurry images for a while. I've been using such fixes for a long time via patching original fast-image lib to make images look better.
Just FYI: trilinear filtration on iOS is heavily used in core react-native image component as well.

@zarv1k

zarv1k commented Feb 2, 2026

Copy link
Copy Markdown
Author

Could you move the filtering lines outside the #if block?

done

@devanshsaini11

Copy link
Copy Markdown
Contributor

@zarv1k
Trilinear filtering requires the generation of a full mipmap chain, which increases VRAM usage. For lists with many high-res images, making this the default could lead to Out-Of-Memory (OOM) crashes on older devices. For better flexibility we can expose this as a prop: trilinearFiltering?: boolean which defaults to false. To avoid prop-drilling, we should allow users to enable this globally. Example: FastImage.setGlobalConfig({ trilinearFiltering: true })

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants