I did a search but didn't find something useful as it is advised to upload images in sRGB profile (obviously)
I would like to do this:
- upload my 3000x2000 images in AdobeRGB profile
> These uploads are not intended for web display but for the client to download.
- generate cache images and thumbnails in sRGB
> I think it is possible to convert color profiles with Imagick
I would like some advise on which files I should look at and maybe any suggestions on how to do it.
Cheers
Comments
Imagick is supposed to be better at memory management than the standard GD library. But even then resizing those images might not work.
But of course, the first step is to see if you even have Imagick capability with your hosting service.
I had some experience with image processing before and ran into GD memory problems. So I learned about Imagick,. and got myself I server who supported it. I had a rough time compiling the imagick module on my Mac though but in the end I won
My ZP installation infos:
PHP memory limit: 140M (Note: Your server might allocate less!)
The trouble shooting page mentioned by acrylian guidlines: (in my 3000 x 2000 px case)
6 MP Image, 2816 x 2112 pixels => needs ~22.6 MB Memory
I had a look in my servers php.ini:
`
;;;;;;;;;;;;;;;;;;;
; Resource Limits ;
;;;;;;;;;;;;;;;;;;;
max_execution_time = 60 ; Maximum execution time of each script, in seconds
max_input_time = 60 ; Maximum amount of time each script may spend parsing request data
memory_limit = 140M ; Maximum amount of memory a script may consume (8MB)
`
So I think I am fine.
---
Just tested it and no problems processing at all!
The cached image and thumb files have indeed the AdobeRGB color profile embedded (with Imagick enabled)
Now if could find out where the imagick functions are writing in ZP...
zp-core.php
zp_resampleImage()
if (IMAGICK_RETAIN_PROFILES)
Now I need to research the conversion (reliability, performance)
Starting to fall in love ZP )
The better alternative, I think, is to upload the sRGB images to Zenphoto and use those as normal. The images will be cached with the sRGB profile as such. Then, I would link to the AdobeRGB images within the theme but outside of Zenphoto. Since you're not displaying the AdobeRGB images, there's really no point to having Zenphoto in the middle, but that's completely my opinion.
If you do decide to add in the functionality, here's a short overview of how `zp_resampleImage()` works for Imagick. The `IMAGICK_RETAIN_PROFILES` define only checks to see if it's possible to use the `Imagick::profileImage()` function. Then, the `foreach` will migrate each profile of the original image to the resampled image. So, depending on if you want the original profiles, you might want to delete that `foreach` statement.
The rest of what you need to add the profile to the image manually should be in the link at the top of my post. Just remember that if you modify core files, you will have to add your modifications again every time you update Zenphoto.
You are right, I should upload AdobeRGB files separately, outside ZP. It's a good excuse for me to charge my users for the extra upload. Most of them will print sRGB anyway.
I found an article on how to do the conversion but it does not really work for me, I think due to the older version of imagick on my host. Actually I can do the conversion but with a filesize way to big (can't delete the ARGB profile before assigning sRGB)
Anyways just for reference:
http://ezzatron.com/2010/03/17/creating-web-thumbnails-with-php-imagick/
Thanks again, great ZP community :-)
If you make both image versions with the same names (e.g. replicated the /albums structure) generating these links would be quite easy.