d3y4n / instagraph

Instagram with ImageMagick & PHP
http://webarto.com
325 stars 69 forks source link

Library does not output the same results on a different box #6

Open honzajavorek opened 11 years ago

honzajavorek commented 11 years ago

This is follow-up of my e-mail sent to @webarto and my StackOverflow question. I downloaded Instagraph and used it with my freshly installed ImageMagick, but the output is different than presented. My version of ImageMagick is ImageMagick 6.7.7-10 2012-08-17 Q16.

As mentioned in the SO question, problem is with colortone function. Expected output is following:

expected

What I get:

test_toaster

My script looks like this:

<?php
include(dirname(__FILE__) . '/Instagraph.php');
$instagraph = new Instagraph;
$instagraph->setInput('test.jpg');
$instagraph->setOutput('test_toaster.jpg');
$instagraph->process('toaster');

What could cause such behavior? Am I doing something wrong?

d3y4n commented 11 years ago

Hello Honza,

Thank you for reporting, I too have noticed differences.

You are not doing anything wrong.

I developed these filter and tested on Imagemagick 6.7.5, it was current at the time, I believe. Filters are not perfect, I didn't own Instagram capable device, and the point was to demonstrate it's really simple thing to do, and with little effort, you can make the same/better ones.

I think the colortone is indeed the problem, i.e. behaving different, I've changed level to 70/80, and it looks better, but needs more tweaking, my current version is ImageMagick 6.8.0-4 2012-10-30 Q16.

I'll answer on Stackoverflow too.

colorspace RGB and sRGB swapped between 6.7.5.5 and 6.7.6.7 though probably not resolved until the latter then -colorspace gray changed to linear between 6.7.6.7 and 6.7.8.2 then -separate converted to linear gray channels between 6.7.6.7 and 6.7.8.2, though probably not resolved until the latter so -colorspace HSL/HSB -separate and -colorspace gray became linear but we need to use -set colorspace RGB before using them at appropriate times so that results stay as in original script The following was determined from various version tests using colortoning. with IM 6.7.4.10, 6.7.6.10, 6.7.8.6

Behavior of these functions changed.

honzajavorek commented 11 years ago

I just compiled the latest upstream ImageMagick (6.8.3-9 2013-03-15 Q16) and it makes no difference. I do not own Instagram capable device either :-) I seek no perfection, I am completely fine with the outputs you presented as samples on NetTuts, but I am not able to reach them.

Thank you for investigating changes in colorspace implementation within ImageMagick, I'll try to tweak the command myself too and let you know if I can somehow fix it :-)

honzajavorek commented 11 years ago

Solved! Thank to guys from ImageMagick forum I got working solution.