WIP: VSE: bilinear upscaling no longer adds transparent border around the image #117279

Closed
Aras Pranckevicius wants to merge 1 commits from aras_p/blender:interp_bilinear_clamp into main

When changing the target branch, be careful to rebase the branch in your fork to match. See documentation.

The code is actually within BLI, but it is mostly used by VSE (and somewhat by Compositor). Ever since low level "bilinear/bicubic" interpolation functions were added back in 2007 (9298357670), they had different behavior in how a pixel that is right on the edge of an image is treated: bilinear was blending in transparent black, whereas bicubic was clamping samples to the image edge.

Make bilinear do the same as bicubic does, which is clamping samples to the edge of an image. For typical use cases this better matches user expectations: they put in low resolution image into say sequencer, it is upscaled, and the whole image covers the whole output, without any transparency appearing aroud the edges.

Performance of bilinear filter (measuring IMB_transform on 4K image) seems to be unchanged.

Here's throwing in an image into a VSE that is 6x larger resolution: note that black outline appears around the edges.

And here's the same with this PR:

The code is actually within BLI, but it is mostly used by VSE (and somewhat by Compositor). Ever since low level "bilinear/bicubic" interpolation functions were added back in 2007 (9298357670f5), they had different behavior in how a pixel that is right on the edge of an image is treated: bilinear was blending in transparent black, whereas bicubic was clamping samples to the image edge. Make bilinear do the same as bicubic does, which is clamping samples to the edge of an image. For typical use cases this better matches user expectations: they put in low resolution image into say sequencer, it is upscaled, and the whole image covers the whole output, without any transparency appearing aroud the edges. Performance of bilinear filter (measuring IMB_transform on 4K image) seems to be unchanged. Here's throwing in an image into a VSE that is 6x larger resolution: note that black outline appears around the edges. ![](/attachments/c48f2d77-d381-4223-bbdc-8ee19ff0c417) And here's the same with this PR: ![](/attachments/ec431c42-9acc-4aa0-a8d3-d91b5d871a68)
Aras Pranckevicius added 1 commit 2024-01-18 13:46:02 +01:00
buildbot/vexp-code-patch-lint Build done. Details
buildbot/vexp-code-patch-linux-x86_64 Build done. Details
buildbot/vexp-code-patch-darwin-x86_64 Build done. Details
buildbot/vexp-code-patch-windows-amd64 Build done. Details
buildbot/vexp-code-patch-darwin-arm64 Build done. Details
buildbot/vexp-code-patch-coordinator Build done. Details
baf672bd78
VSE: bilinear upscaling no longer adds transparent border around the image
The code is actually within BLI, but it is mostly used by VSE (and
somewhat by Compositor). Ever since low level "bilinear/bicubic"
interpolation functions were added back in 2007 (9298357670), they
had different behavior in how a pixel that is right on the edge
of an image is treated: bilinear was blending in transparent black,
whereas bicubic was clamping samples to the image edge.

Make bilinear do the same as bicubic does, which is clamping samples
to the edge of an image. For typical use cases this better matches
user expectations: they put in low resolution image into say
sequencer, it is upscaled, and the whole image covers the whole output,
without any transparency appearing aroud the edges.

Performance of bilinear filter (measuring IMB_transform on 4K image)
seems to be unchanged.
Author
Member

@blender-bot build

@blender-bot build
Author
Member

Replaced by #117717

Replaced by #117717
Some checks failed
buildbot/vexp-code-patch-lint Build done.
buildbot/vexp-code-patch-linux-x86_64 Build done.
buildbot/vexp-code-patch-darwin-x86_64 Build done.
buildbot/vexp-code-patch-windows-amd64 Build done.
buildbot/vexp-code-patch-darwin-arm64 Build done.
buildbot/vexp-code-patch-coordinator Build done.

Pull request closed

Sign in to join this conversation.
No reviewers
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#117279
No description provided.