Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FEATURE: Automatic conversion of images from CMYK into RGB colorspace #376

Merged
merged 9 commits into from Apr 26, 2016
Expand Up @@ -108,6 +108,12 @@ public function processImage(FlowResource $originalResource, array $adjustments)
}

$imagineImage = $this->imagineService->open($resourceUri);

$convertCMYKToRGB = Arrays::getValueByPath($this->settings, 'image.convertCMYKToRGB');
if ($convertCMYKToRGB && $imagineImage->palette() instanceof \Imagine\Image\Palette\CMYK) {
$imagineImage->usePalette(new \Imagine\Image\Palette\RGB());
}

if ($this->imagineService instanceof \Imagine\Imagick\Imagine && $originalResource->getFileExtension() === 'gif' && $this->isAnimatedGif(file_get_contents($resourceUri)) === true) {
$imagineImage->layers()->coalesce();
$layers = $imagineImage->layers();
Expand Down
1 change: 1 addition & 0 deletions TYPO3.Media/Configuration/Settings.yaml
Expand Up @@ -39,6 +39,7 @@ TYPO3:
defaultOptions:
# Image quality, from 0 to 100
'quality': 90
convertCMYKToRGB: false

thumbnailGenerators:

Expand Down
28 changes: 28 additions & 0 deletions TYPO3.Neos/Documentation/HowTos/ConfigureImageGeneration.rst
@@ -0,0 +1,28 @@
==========================
Copy link
Contributor

Choose a reason for hiding this comment

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

This documentation should be added to the media package documentation instead of the Neos documentation. See https://github.com/neos/neos-development-collection/tree/master/TYPO3.Media/Documentation (http://neos-media.readthedocs.org)

Configure image generation
==========================

Changing output quality of images
=================================

You can change the output quality of generated images within your Settings.yaml.
Set the `quality` to your preferred value (between 0 - very poor and 100 - very good).

.. code-block:: yaml
TYPO3:
Media:
image:
defaultOptions:
'quality': 90


Convert CMYK images into RGB
============================

If you are working with CMYK images and like to convert them automatically for web usage, you can activate this within your Settings.yaml:

.. code-block:: yaml
TYPO3:
Media:
image:
convertCMYKToRGB: true #default is false