Comments (9)
This is a big problem for me as well (ImageMagick 6.7.8-9). With -colorspace RGB it darkens all my images, but without it it works fine.
Here's an original image: http://i.imgur.com/hJqqj.jpg
And here's resize() called on it: http://i.imgur.com/xiwvD.jpg
I just removed the default colorspace lines, hopefully there's no unintended issues with that, but I guess I'll find out.
from flourish-classes.
Now the issue is with -colorspace RGB the colours are way too dark.
Original: http://ky.tatsh.net/files/images/img_0246_copy1.jpg
Resized to 250px width: http://ky.tatsh.net/files/images/thumbs/img_0246.jpg
Command line:
'/usr/bin/convert' \
'jpg:/home/tatsh/dev/kusaba-y/files/images/thumbs/__flourish_temp/img_0246.jpg[0]' \
-resize "250x187" \
-colorspace RGB \
-compress JPEG \
-quality 90 \
'jpg:/home/tatsh/dev/kusaba-y/files/images/thumbs/__flourish_temp/img_0246.jpg' 2>&1
from flourish-classes.
It seems there are two options:
- Downgrade to a functioning version of ImageMagick
- Change fImage to detect the color palette of the original file and convert to RGB if the original is CMYK and the destination is JPG or PNG. This flag was originally added to handle resizing CMYK tiff files to JPGs since my last company wrote an app that ran into that situation quite frequently.
from flourish-classes.
I would prefer option 2 but I am unsure it is necessary, and for processing many images at once, would that not be a performance hindrance?
My solution is to just remove defaulting to any colorspace and let ImageMagick do the work. This means removing the check and adding. I already did this in my fork and I am having no problems (tested mostly pictures that come off my iPhone which uses sRGB). A user on the IRC channel for ImageMagick suspects a gamma conversion is occurring, but is unsure.
from flourish-classes.
This issue with removing this is that resulting JPGs end up being CMYK JPGs, which don't display at all in some browsers.
from flourish-classes.
That is definitely worrying. Even IE 8 cannot show CMYK images.
The only way to check easily I think is to read using identify -verbose
and get the line that has jpeg:colorspace: n
(parse it) and fallback to exif_read_data()
. Sometimes photos have no EXIF data so in the worse the case -colorspace
argument may have to default to RGB.
from flourish-classes.
According to this page, ImageMagick 6.7.5 and up set the default colorspace to sRGB.
http://www.imagemagick.org/Usage/resize/#resize_colorspace
from flourish-classes.
Yeah, according to that page, it appears previous to 6.7.5, RGB and sRGB were swapped. To it appears the "fix" is to detect the version of ImageMagick and change the flag accordingly.
from flourish-classes.
This should come close and works for me.
from flourish-classes.
Related Issues (20)
- fCache unserialize error
- fEmail exec shell_exec check doesn't make sense
- fActiveRecord silently overrides some column defaults on insert HOT 1
- loadHTMLBody Issues
- fResult doesn't unescape integer and float types.
- parseResponse in fMailbox.php dies when the mail subject includes {123456} HOT 3
- Any way to add non database "fields" to fActiveRecord?
- Creating functions and procedures
- Send email as Content-Transfer-Encoding: 8bit
- fEmail: Validate error at UTF-8 encoded recipient
- Double quotes in Email subject are not fecthed HOT 1
- PostgreSQL fActiveRecord::populate sets auto_increment field to 0 as default
- Microsoft Outlook Web Access and certain attachments (Content-ID)
- fMailbox.php doesn't always split the references in to an array as expected
- listMessages() returned empty array due to trailing whitespace in IMAP response HOT 1
- Type: fConnectivityException Message
- Is the project dead? HOT 8
- Can you advice me how to catch all errors and print them nicely using the flourish fCore? HOT 3
- Command Line Script HOT 1
- Database table have the specified column but script stop working
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from flourish-classes.