Photoshop PSD support

We now support the combined layer of Photoshop files (stored as layer 0
in the file). This way users can keep their files as multilayer PSD and
Blender always handle them as flat images.

For perfect alpha this requires an OpenImageIO update:
342cc2633f

Photoshop sample files:
https://github.com/OpenImageIO/oiio-images

Brecht has some pending fixes to push for OIIO as well, so we may as
well wait to update our libraries.

What works:
===========
* 8bit images (with or without alpha)
* 16bits images (alpha discarded)
* Photoshop files saved with 'Maximum Compatibility'
* Cycles, Blender internal,  BGE (and player)

Known limitations
(due to OIIO dependency):
=========================
* Images with less than 4 channels show a wrong thumbnail (bug may be in  OIIO)
* Packed images are not supported
* We do not write PSD files.

Note: old Blenders have support for PSD via Quicktime library. But due
to license issues this was discontinued.

Many thanks for Brecht van Lommel for reviewing the patch, suggesting
multiple improvements and to help solving the alpha issue.
This commit is contained in:
Dalai Felinto
2013-10-08 21:17:24 +00:00
parent 590f58d455
commit 4abb8fde95
26 changed files with 646 additions and 73 deletions

View File

@@ -206,6 +206,7 @@ option(WITH_MOD_OCEANSIM "Enable Ocean Modifier" OFF)
option(WITH_IMAGE_OPENEXR "Enable OpenEXR Support (http://www.openexr.com)" ON)
option(WITH_IMAGE_OPENJPEG "Enable OpenJpeg Support (http://www.openjpeg.org)" ON)
option(WITH_IMAGE_TIFF "Enable LibTIFF Support" ON)
option(WITH_IMAGE_PSD "Enable Photoshop PSD Support" ON)
option(WITH_IMAGE_DDS "Enable DDS Image Support" ON)
option(WITH_IMAGE_CINEON "Enable CINEON and DPX Image Support" ON)
option(WITH_IMAGE_HDR "Enable HDR Image Support" ON)
@@ -441,6 +442,11 @@ if(NOT WITH_PYTHON)
set(WITH_CYCLES OFF)
endif()
# auto enable openimageio for photoshop psd
if(WITH_IMAGE_PSD)
set(WITH_OPENIMAGEIO ON)
endif()
# enable boost for cycles, booleans, audaspace or i18n
# otherwise if the user disabled
if(NOT WITH_BOOST)
@@ -2297,6 +2303,7 @@ if(FIRST_RUN)
info_cfg_option(WITH_IMAGE_OPENJPEG)
info_cfg_option(WITH_IMAGE_REDCODE)
info_cfg_option(WITH_IMAGE_TIFF)
info_cfg_option(WITH_IMAGE_PSD)
info_cfg_text("Audio:")
info_cfg_option(WITH_OPENAL)