Hello.
Gallery 3.09
Linux 3.11-2-amd64
Graphics toolkit: imagemagick
I understand that if I upload a 1024 wide image, and make the max image size setting match,
a 'copy' or 'resize' image will be created for each image.
In this circumstance, is the 'resize' image an exact copy ?
What method and what setting is used to make the 'resize' image...
i.e. jpeg compression setting, quality conversion setting of
lanczos, Lagrange... etc.
Can I assign the quality compression and method used to make the 'resize' copy images ?
Also, can I make my own thumbnails if they are identically matched in size, and replace G3 thumbs ?
Thank you.
Posts: 27300
Not exact. Depending on the image toolkit.....
There is 2 advanced settings you can change:
image_sharpen the default is 15
and
image_quality the default is 75
The quality depends on the image toolkit as well.
If I understand your question then yes if the aspect ratio and size are the same. I'm assuming you want a different crop?
Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team
Posts: 26
Floridave...
Using Imagemagick toolkit.
Which command function is gallery using for sharpen and quality please ?
Regarding thumbnails, not a different crop, increased quality... is the
quality setting accessible via gallery as well ?
Cheers.
Posts: 27300
Sharpen and quality is from the kohana library:
gallery3/system/libraries/drivers/ImageMagic.php
public function sharpen($amount) and public function process() there is quality settings as well.
Yes via the advanced settings.
Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team
Posts: 26
Thanks for the quick reply Floridave.
I'm using Gallery 3 from inmotionhosting.com.
They offer imagemagick and gd as graphics toolkits for use with Gallery3.
Is it possible to use an imagemagick standard command with Gallery3 such as;
convert original.jpg -colorspace RGB -filter Cosine -resize 1024 -colorspace sRGB result.jpg
Thank you.
Posts: 27300
You would have to look though the code for the convert function Kohana uses to customize to what your after.
Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team
Posts: 26
OK, thanks again Floridave.
Is that possible for both the resize and thumbnail images ?
Posts: 814
I sure could use some See's Lolli-pops!
Just sayin'!
Posts: 26
Excuse me Floridave...
There is no: gallery3/system/libraries/drivers/ImageMagic.php
Do you mean ?: gallery3/system/libraries/drivers/Image/ImageMagic.php
If I grep for the word 'resize', I get this...
$ grep resize ImageMagic.php
public function resize($prop)
if ($error = exec(escapeshellcmd($this->dir.'convert'.$this->ext).' -background '.$this->background.' -flatten -resize '.$dim.' '.$this->cmd_image.' '.$this->cmd_image))
Question: Is this the line I need to modify to incorporate the;
convert original.jpg -colorspace RGB -filter Cosine -resize 1024 -colorspace sRGB result.jpg
Thanks again.
Posts: 27300
Yes.
looks to me like the command you would want to edit to add your customization. Depending on the IM version, some options might not be available. Speed might be an issue to consider as well with different options/operations.
Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team
Posts: 26
Excuse me Floridave but,
Is there a link somewhere that details the procedure to change ImageMagic.php to
incorporate the 'convert original.jpg -colorspace RGB -filter Cosine -resize 1024 -colorspace sRGB result.jpg' ?
If I understand correctly, the line 'public function resize($prop) is the correct line to modify.
Thank you.
Posts: 27300
Sorry no. It is a kohana 3rd party code that we use.
try to modify that line and see how far you get. I would start like:
if ($error = exec(escapeshellcmd($this->dir.'convert'.$this->ext).' -colorspace RGB -filter Cosine -background '.$this->background.' -flatten -resize '.$dim.' '.$this->cmd_image.' '.$this->cmd_image))
Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team
Posts: 26
Will do...
I'll try your 'convert' modification suggestion.
Thank you for the help.
[SOLVED]
Posts: 27300
And your results for the benifit of others?
Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team
Posts: 26
Floridave,
I've had a high level of success with dramatically increasing the
quality of my resizes over anything Photoshop offers, using imagemagick.
I've reduced 4000 pixel wide images to 1024 without halos and maintained
acceptable levels of sharpness.
I love Gallery3 and I'm always interested in elevating any ability to
customize and increase the quality of the images displayed... which
unfortunately at the moment is automatic.
I would love to participate in achieving my objective (using imagemagick)
to customize the quality of the 'resized' image Gallery3 automatically
produces... but your proposed solution is a theory at the moment and
beyond my programming.
It's my opinion a person in your position of connection
to this project and your level of programming experience
could offer a substantial amount of benefit to us as users
if you achieve resolution to your proposed solution.
It would be of great benefit to all Gallery3 users to posses a
working method to increase and/or customize the quality Gallery3
automatically generates in the 'resize' images it automatically produces,
with imagemagick.
Thanks again.
Cheers.
Posts: 27300
Have you seen
http://codex.galleryproject.org/Gallery3:Modules:image_optimizer
Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team
Posts: 26
Floridave, thanks for the link.
You'll let us know if you ever successfully achieve your
manual code change to ImageMagic.php as suggested eh?
All the best.
Posts: 26
Floridave...
Some preliminary results to share.
I've tried your theory and changed the ImageMagick.php to;
if ($error = exec(escapeshellcmd($this->dir.'convert'.$this->ext).' -colorspace RGB -filter Lagrange -background '.$this->background.' -flatten -resize -colorspace sRGB '.$dim.' '.$this->cmd_image.' '.$this->cmd_image))
I added;
-colorspace RGB -filter Lagrange
-colorspace sRGB
I didn't rebuild any images, I"m hoping this is done 'on the fly' and if so,
my changes apparently didn't break anything, it still works when I click on a thumbnail to show
a 'resize' image, and when I click on the 'resize' it shows the original image I uploaded.
1. Can I have G3 log resizes so I can see if it's working ?
2. There are other sections mentioning 'convert', should I change those also ?
3. Will these changes to ImageMagick.php also apply to thumbnail creation ?
Thank you.
Posts: 27300
i don't think we call resize for every view just when we add items or rebuild them.
I don't understand you would have to look at the resize results in the var directory.
Your guess is as good as mine. See what the results are first.
Yes I believe so.
Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team