Commit graph

20 commits

Author SHA1 Message Date
Jesse Yurkovich
1a936ca8f9 Fix #154260: Inconsistent AVIF BW output support
It turns out the workaround for #154260 only disabled AVIF BW saving for
the Image->Save UI, but not in the Output Properties UI. So while 5.1
will remain problematic when using those settings, 5.2 has updated
libraries and can successfully output in both places.

Re-enable the Image->Save UI to make things consistent and add dedicated
BW variations to the imbuf suite of tests.

Pull Request: https://projects.blender.org/blender/blender/pulls/160576
2026-06-24 21:22:29 +02:00
Jesse Yurkovich
c7844088e4 Tests: Add imbuf tests for the iris image format
Pull Request: https://projects.blender.org/blender/blender/pulls/157865
2026-04-27 20:59:48 +02:00
Sebastian Parborg
fe30b5b705 Build: Make OpenColorIO and OpenEXR mandatory deps
Both OpenColorIO and OpenEXR were implicitly always required as these are non optional dependencies of OpenImageIO. Because OpenImageIO currently doesn't try to find these dependencies by itself properly, we get build failures in bpy and lite builds when OpenColorIO and/or OpenEXR is turned off on the Blender side of things. (However, they do properly list them as dependencies in cmake, so if you manually look for them, the OpenImageIO cmake target will pull in all of the required libraries properly)

As OpenImageIO is a mandatory dependency, make OpenColorIO and OpenEXR mandatory as well as these libraries need to be included either way for OpenImageIO (and by extension Blender) to work.

Because of this we can again remove the linker workarounds as now we should properly pull in the needed dependencies where needed.

Pull Request: https://projects.blender.org/blender/blender/pulls/156154
2026-04-22 17:39:44 +02:00
Brecht Van Lommel
fac8b300e0 Fix #152455: OpenEXR DWAA/DWAB saving leads to inf values
DWAA/DWAB lossy compression uses DCT-based encoding, where values near
HALF_MAX can overshoot to infinity after decompression, due to DCT ringing.

There are different ways to resolves it and it's not so clear what the ideal
solution would be and how it would be handled upstream. By default it
will already convert values > HALF_MAX to inf and it's up to the application
to clamp if they want to (like we do).

As a workaround, clamp half float values before writing with an empirically
determined value that takes into account that lower quality makes this
problem worse. The resulting files should then decompress without inf in
existing software.

Pull Request: https://projects.blender.org/blender/blender/pulls/154061
2026-02-09 13:10:39 +01:00
Brecht Van Lommel
c17eb901f7 Tests: Put exr dwaa/dwab quality in file name 2026-02-09 13:10:38 +01:00
Brecht Van Lommel
abf187f4c9 Revert "Tests: Temporarily disable OpenEXR HTJ2K saving tests"
This reverts commit 515a956884. The test
should now be reliable with the latest library update.

Fix #153443

Pull Request: https://projects.blender.org/blender/blender/pulls/153977
2026-02-06 00:27:47 +01:00
Brecht Van Lommel
343c71beb2 Images: AVIF file format read and write support
It can be used for saving HDR images that work in most web browsers and
image editors. Unlike HDR PNG, this can use lossy compression to make file
sizes much smaller.

The options are 8/10/12 bit and a quality percentage.

Pull Request: https://projects.blender.org/blender/blender/pulls/153540
2026-02-06 00:15:05 +01:00
Jesse Yurkovich
952d2ed026 Image: Use OIIO for loading/saving WEBP format
This removes most of the low-level usage of libwebp in favor of using
OIIO directly. The thumbnail code remains the same as it's more
efficient to use the built-in scaling support there.

Added additional tests for lossless quality. No other changes to
features and performance are expected or noticed.

Note: the error message when saving unsupported large images is
suboptimal until the library update associated with #153493 is complete.

Pull Request: https://projects.blender.org/blender/blender/pulls/153567
2026-02-02 20:49:24 +01:00
Brecht Van Lommel
515a956884 Tests: Temporarily disable OpenEXR HTJ2K saving tests
Until the random encoding failures are fixed.

Ref #153443

Pull Request: https://projects.blender.org/blender/blender/pulls/153452
2026-01-27 12:57:01 +01:00
Jesse Yurkovich
dacb4b67b7 Tests: Image: Enable previously excluded webp variations
Certain WEBP image test variations had issues on the ARM platforms where
the result would not quite match the reference images generated on x64
machines. With the update to `libwebp` for 5.1 these seem fixed now.

Fixes #105006

Pull Request: https://projects.blender.org/blender/blender/pulls/153306
2026-01-26 20:51:16 +01:00
Brecht Van Lommel
497440cb39 OpenEXR: Add support for HTJ2K encoding
This is a new lossless encoding in OpenEXR 3.4 based on high throuhput
JPEG 2000. It produces somewhat smaller files than other lossless
compression methods, but is very new and not widely supported yet by
other software.

Pull Request: https://projects.blender.org/blender/blender/pulls/153292
2026-01-25 14:25:57 +01:00
Campbell Barton
7f48e82200 Cleanup: format 2024-10-16 21:09:25 +11:00
Aras Pranckevicius
8b275092e0 Image: Add Quality setting to EXR DWAA/DWAB compression
EXR DWAA and DWAB are conceptually similar to lossy JPG compression,
with a tunable file size vs image quality parameter. However, previously
Blender always used the fixed default setting, which is kinda similar
to very high quality (like 97) for JPG.

Internally EXR DWA/DWB quality parameter is inverted scale, i.e. 0 is
best/lossless quality, and increased setting value means decreased
quality. However the rest of Blender UI uses 1-100 JPG-like quality
scale, where values above 90 are "visually lossless", 100 is lossless,
and going below something like 50 would be visually quite lossy. So map
that to internal DWA setting:
- blender 100 -> DWA 0
- blender 97 -> DWA 45
The rest is linear relation based on those two points.

Pull Request: https://projects.blender.org/blender/blender/pulls/128790
2024-10-09 12:34:49 +02:00
Sergey Sharybin
f11292104d Render Tests: Separate difference of Color and Alpha
This change fixes confusion situation when the render output
is an RGBA image: the difference in color was not visible in
the report because alpha channel was all zeros. This is due
to idiff performing per-channel difference.

The solution to this problem is to have separate images for
color and alpha difference, which makes it clear where the
difference actually is coming from.
2024-01-25 10:04:16 +01:00
Zijun Zhou
a9053f7efb Color management: Add AgX view transform and make it default
On a user level this view transform provides much better handling of colors in
the over-exposed areas.

With this configuration the following display devices are available, including
AgX view transform for them:
* sRGB
* Display P3
* Rec.1886
* Rec.2020

NOTE: There is no Filmic view transform available for the newly added display
devices.

AgX also brings an implementation of False Colors view transform, which replaces
Filmic-based, and is available for all display devices.

The backward compatibility is preserved. The new files will default to AgX view
transform, which makes it non-forward compatible.

More technical details is available in the original PR #106355.
Please note that the PR has been split into more incremental changes when
was landing.

Pull Request: https://projects.blender.org/blender/blender/pulls/111099
2023-08-22 12:53:15 +02:00
Campbell Barton
e955c94ed3 License Headers: Set copyright to "Blender Authors", add AUTHORS
Listing the "Blender Foundation" as copyright holder implied the Blender
Foundation holds copyright to files which may include work from many
developers.

While keeping copyright on headers makes sense for isolated libraries,
Blender's own code may be refactored or moved between files in a way
that makes the per file copyright holders less meaningful.

Copyright references to the "Blender Foundation" have been replaced with
"Blender Authors", with the exception of `./extern/` since these this
contains libraries which are more isolated, any changed to license
headers there can be handled on a case-by-case basis.

Some directories in `./intern/` have also been excluded:

- `./intern/cycles/` it's own `AUTHORS` file is planned.
- `./intern/opensubdiv/`.

An "AUTHORS" file has been added, using the chromium projects authors
file as a template.

Design task: #110784

Ref !110783.
2023-08-16 00:20:26 +10:00
Campbell Barton
65f99397ec License headers: use SPDX-FileCopyrightText in all sources 2023-06-15 13:35:34 +10:00
Jesse Yurkovich
aa3bdfd76a Image: Use OpenImageIO for loading and saving a variety of image formats
This checkin will use OIIO to replace the image save/load code for BMP,
DDS, DPX, HDR, PNG, TGA, and TIFF.

This simplifies our build environment, reduces binary duplication,
removes large amounts of hard to maintain code, and fixes some bugs
along the way.

It should also help reduce rare differences between Blender and Cycles
which already uses OIIO for most situations. Or potentially makes them
easier to solve once discovered.

This is a continuation of the work for #101413

Pull Request: https://projects.blender.org/blender/blender/pulls/105785
2023-04-12 05:22:26 +02:00
Jesse Yurkovich
2d34a09043 Tests: Address imbuf_save failures on ARM64 builds
This does 2 things to address the ARM64 failures:
- Increases the threshold to be inline with what Cycles uses
- Disables the 2 problematic WebP variations (#105006 will track)
2023-02-20 21:36:19 -08:00
Jesse Yurkovich
7699c7407d Tests: Add tests for image format saving and loading
This adds saving and loading tests for our supported image formats.

**Saving - bf_imbuf_save.py**
There are 2 template images which are loaded anew for each file save
attempt.  One is an 8-bit RGBA image and the other 32-bit. This is
required as many formats use a variety of factors to determine which of
`ibuf->rect` or `ibuf->rectfloat` to use for processing.  The templates
are constructed to have alpha transparency as well as values > 1 (or
clamped to 1 for the case of the 8-bit template).

Test flow:
 - Load in an appropriate template image
 - Save it to the desired format with the desired set of options
 - Compare against the reference image

Notes:
 - 98 references are used totaling ~3.6MB
 - 10-12 second test runtime
 - Templates can be reconstructed with the create-templates.blend file

**Loading - bf_imbuf_load.py**
Test flow:
 - Load in each of the reference images
 - Save them back out as .exr
 - Save additional metadata to a secondary file (alpha mode, colorspace etc)
 - Compare the saved out .exr with another set of reference .exrs
 - Compare the saved out file metadata with set of reference metadata

Notes:
 - 98 exr references are used totaling ~10MB
 - 10-12 second test runtime as well

A HTML report is not implemented. The diff output organization is very
similar to the other tests so it should be somewhat easy to do in the
future if we want.

The standard set of environment variables are implemented for both:
BLENDER_TEST_UPDATE, BLENDER_VERBOSE, and BLENDER_TEST_COLOR

Pull Request #104442
2023-02-20 19:06:38 -08:00