VSE: Improve image filtering defaults/options #116980

Closed
opened 2024-01-10 12:38:23 +01:00 by Aras Pranckevicius · 1 comment

Currently, image/movie content in sequencer can be transformed by using the per-strip transform options, or using the Transform Effect strip. They have these filtering options:

  • Strip transform section: Nearest, Bilinear (default), Subsampled 3x3
  • Transform Effect strip: Nearest, Bilinear (default), Bicubic

Several problems with the current situation:

  • The only way to get higher quality filtering when scaling images up, is to use Transform Effect, since that offers Bicubic.
  • The only way to get decent quality when scaling images down (beyond 2x down scale) is to use Subsampled 3x3, but that only works well down to about 3x down scaling, and starts to "miss source pixels" beyond that.
  • There's no option for "just do the most appropriate thing depending on scale up/down level", which arguably should be the default.
  • There's no option to change Sequencer preview between "faster playback, possibly worse filtering" and "match render result, possibly slower playback". e.g. like Compositor has performance/quality options for Render vs Edit.

Proposed Improvements

  • Add "playback quality" option to Sequencer preview window, that could toggle between "full quality" (i.e. "as rendered"), and "faster playback" (image filtering would never go beyond bilinear complexity).
  • Add Auto filter option to strips, and (for new files / new strips) default to that. Which would have logic perhaps like (actual details TBD):
    • When scaling up beyond 2x, use Bicubic (Mitchell)
    • When scaling between 2x up and 2x down, use Bilinear,
    • When scaling down beyond 2x, use, uhh, "some sort of good area sampling filter". The critical thing is that it should sample the whole footprint of input image.
    • When there is no scaling or rotation at all, and translation is not fractions of a pixel, can just use Nearest.
  • Each strip can still individually pick the filter used, besides Auto.

Notes on which filters should be presented as choices at all:

  • Nearest and Bilinear already exist, are simple to understand, they stay.
  • Bicubic (right now only exists in Transform Effect) should stay. Add it as option for regular strips (done: #117100). Perhaps clarify that it is a "B-Spline" bicubic variety.
  • Add Mitchell bicubic option (at least to VSE/Compositor).
  • Subsampled 3x3 that exists today is really just a special case of Box filter for 3x scaling down. It should be extended to handle arbitrary downscaling ratios, and perhaps renamed to Box.

Somewhat related question: when scaling up, Bilinear today results in an edge of transparency around the image. This is mostly visible when using large upscaling ratios. Need to decide if this is wanted behavior, or whether it should be changed somehow.

An interactive "playground" of various image upscaling filtering algorithms: https://aras-p.info/img/misc/upsample_filter_comp_2024/

Work items

  • Bicubic:
    • Optimize bicubic to be faster #117100
    • Add Cubic BSpline to strip transform options #117100
    • Add Cubic Mitchell to strip transform options #117517
  • Make Bilinear not add in a transparent border when upscaling #117717
    • Change IMB_transform rasterizer to anti-alias actual edges #117717
  • Subsampled:
    • Make it faster #117125
    • Make it support arbitrary scaling ratios, and rename to Box #117584
  • Auto filter:
    • Add option to strip transforms #117853
    • Decide on actual logic that it would do in which cases, document it
  • VSE preview option for picking performance vs quality
Currently, image/movie content in sequencer can be transformed by using the per-strip transform options, or using the Transform Effect strip. They have these filtering options: - Strip transform section: Nearest, Bilinear (default), Subsampled 3x3 - Transform Effect strip: Nearest, Bilinear (default), Bicubic Several problems with the current situation: - The only way to get higher quality filtering when scaling images up, is to use Transform Effect, since that offers Bicubic. - The only way to get decent quality when scaling images down (beyond 2x down scale) is to use Subsampled 3x3, but that only works well down to about 3x down scaling, and starts to "miss source pixels" beyond that. - There's no option for "just do the most appropriate thing depending on scale up/down level", which arguably should be the default. - There's no option to change Sequencer preview between "faster playback, possibly worse filtering" and "match render result, possibly slower playback". e.g. like Compositor has performance/quality options for Render vs Edit. ### Proposed Improvements - Add "playback quality" option to Sequencer preview window, that could toggle between "full quality" (i.e. "as rendered"), and "faster playback" (image filtering would never go beyond bilinear complexity). - Add `Auto` filter option to strips, and (for new files / new strips) default to that. Which would have logic perhaps like (actual details TBD): - When scaling up beyond 2x, use Bicubic (Mitchell) - When scaling between 2x up and 2x down, use Bilinear, - When scaling down beyond 2x, use, uhh, "some sort of good area sampling filter". The critical thing is that it should sample the whole footprint of input image. - When there is no scaling or rotation at all, and translation is not fractions of a pixel, can just use Nearest. - Each strip can still individually pick the filter used, besides Auto. Notes on which filters should be presented as choices at all: - `Nearest` and `Bilinear` already exist, are simple to understand, they stay. - `Bicubic` (right now only exists in Transform Effect) should stay. Add it as option for regular strips (done: #117100). Perhaps clarify that it is a "B-Spline" bicubic variety. - Add `Mitchell` bicubic option (at least to VSE/Compositor). - `Subsampled 3x3` that exists today is really just a special case of Box filter for 3x scaling down. It should be extended to handle arbitrary downscaling ratios, and perhaps renamed to `Box`. Somewhat related question: when scaling up, `Bilinear` today results in an edge of transparency around the image. This is mostly visible when using large upscaling ratios. Need to decide if this is wanted behavior, or whether it should be changed somehow. An interactive "playground" of various image upscaling filtering algorithms: https://aras-p.info/img/misc/upsample_filter_comp_2024/ ### Work items - [x] Bicubic: - [x] Optimize bicubic to be faster #117100 - [x] Add Cubic BSpline to strip transform options #117100 - [x] Add Cubic Mitchell to strip transform options #117517 - [x] Make Bilinear not add in a transparent border when upscaling #117717 - [x] Change IMB_transform rasterizer to anti-alias actual edges #117717 - [x] Subsampled: - [x] Make it faster #117125 - [x] Make it support arbitrary scaling ratios, and rename to Box #117584 - [x] Auto filter: - [x] Add option to strip transforms #117853 - [x] Decide on actual logic that it would do in which cases, document it - [ ] ~~VSE preview option for picking performance vs quality~~
Aras Pranckevicius added the
Type
Design
label 2024-01-10 12:38:23 +01:00
Aras Pranckevicius self-assigned this 2024-01-10 12:38:53 +01:00
Aras Pranckevicius added this to the Video Sequencer project 2024-01-10 12:38:59 +01:00
Aras Pranckevicius added
Type
To Do
and removed
Type
Design
labels 2024-01-18 12:06:10 +01:00
Author
Member

Considering this "done" for now (i.e. for 4.1). Did not add the "VSE preview option for picking performance vs quality" option, since so far haven't found a convincing use case that the option is needed.

Considering this "done" for now (i.e. for 4.1). Did not add the "VSE preview option for picking performance vs quality" option, since so far haven't found a convincing use case that the option is needed.
Blender Bot added the
Status
Archived
label 2024-02-15 10:20:50 +01:00
Sign in to join this conversation.
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
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#116980
No description provided.