Piwigo.org

You are not logged in. (Register / Login)

Announcement

#1 2015-01-13 11:52:22

plg
Piwigo Team
Location: Nantes, France, Europe
Registered: 2002-04-05
Posts: 13060
Website

[resolved] black and white photos getting brigher with watermark

Hi,

I have a high contrast black&white photo. The resize works fine and the brightness is not altered.

http://piwigo.org/forum/showimage.php?pid=157136&filename=nb-small-contrast-high.jpg

When I add a watermark, it suddenly becomes much brighter.

http://piwigo.org/forum/showimage.php?pid=157136&filename=nb-small-contrast-low-watermark.jpg

The problem occurs with convert 6.7.7 but not with an older version like 6.5.7 (I have this one on my desktop) and removing the $this->add_command('sampling-factor', '4:2:2' ); doesn't change anything.

I see the options to add the watermark are:

Code:

  function compose($overlay, $x, $y, $opacity)
  {
    $param = 'compose dissolve -define compose:args='.$opacity;
    $param .= ' '.escapeshellarg(realpath($overlay->image->source_filepath));
    $param .= ' -gravity NorthWest -geometry +'.$x.'+'.$y;
    $param .= ' -composite';
    $this->add_command($param);
    return true;
  }

rvelices, did you try other settings for watermarking? (so that I don't start "from scratch")


Uploaded Images


Latest blog post (March 23th 2017) Piwigo.com Enterprise plans, now official!

Offline

 

#2 2015-01-13 12:08:03

rvelices
Piwigo Team
Registered: 2005-12-29
Posts: 1953
Website

Re: [resolved] black and white photos getting brigher with watermark

plg wrote:

rvelices, did you try other settings for watermarking? (so that I don't start "from scratch")

Not really. These settings come from imagick help ... I have no idea why this happens ...

Offline

 

#3 2015-01-13 15:45:27

flop25
Piwigo Team
Registered: 2006-07-06
Posts: 6566
Website

Re: [resolved] black and white photos getting brigher with watermark

does the IM version has an impact?


To get a better help : Politeness like Hello-A link-Your past actions precisely described
Check my extensions : more than 30 available
who I am and what I do : http://fr.gravatar.com/flop25
My gallery : an illustration of how to integrate Piwigo in your website

Offline

 

#4 2015-01-13 15:48:53

plg
Piwigo Team
Location: Nantes, France, Europe
Registered: 2002-04-05
Posts: 13060
Website

Re: [resolved] black and white photos getting brigher with watermark

Yes :-)

plg wrote:

The problem occurs with convert 6.7.7 but not with an older version like 6.5.7


Latest blog post (March 23th 2017) Piwigo.com Enterprise plans, now official!

Offline

 

#5 2015-01-13 16:31:23

rvelices
Piwigo Team
Registered: 2005-12-29
Posts: 1953
Website

Re: [resolved] black and white photos getting brigher with watermark

Just to make sure. If you strip all metadata from the source and you convert, the issue exists ?

Offline

 

#6 2015-01-16 14:19:23

plg
Piwigo Team
Location: Nantes, France, Europe
Registered: 2002-04-05
Posts: 13060
Website

Re: [resolved] black and white photos getting brigher with watermark

Same problem when I apply "jhead -purejpg" (removes all metadata) on the JPEG file before uploading.


Latest blog post (March 23th 2017) Piwigo.com Enterprise plans, now official!

Offline

 

#7 2015-01-16 15:01:10

plg
Piwigo Team
Location: Nantes, France, Europe
Registered: 2002-04-05
Posts: 13060
Website

Re: [resolved] black and white photos getting brigher with watermark

New interesting test. In Gimp, I have converted the photo to RGB mode (instead of Grayscale) and now the brightness is correct with the watermark.

http://piwigo.org/forum/showimage.php?pid=157199&filename=rgb-small-contrast-high-watermark.jpg


Uploaded Images


Latest blog post (March 23th 2017) Piwigo.com Enterprise plans, now official!

Offline

 

#8 2015-01-16 15:10:06

plg
Piwigo Team
Location: Nantes, France, Europe
Registered: 2002-04-05
Posts: 13060
Website

Re: [resolved] black and white photos getting brigher with watermark

Before -compose, if I add:

Code:

-colorspace RGB

then we get a nice result :-) the question is "should we always add this option in function compose(...) ?".


Latest blog post (March 23th 2017) Piwigo.com Enterprise plans, now official!

Offline

 

#9 2015-01-16 15:24:25

flop25
Piwigo Team
Registered: 2006-07-06
Posts: 6566
Website

Re: [resolved] black and white photos getting brigher with watermark


To get a better help : Politeness like Hello-A link-Your past actions precisely described
Check my extensions : more than 30 available
who I am and what I do : http://fr.gravatar.com/flop25
My gallery : an illustration of how to integrate Piwigo in your website

Offline

 

#10 2015-01-16 16:46:34

sport
Member
Registered: 2014-03-16
Posts: 74

Re: [resolved] black and white photos getting brigher with watermark

Is it not in the watermark picture?
i have no problems.
Check http://sportplaatje.nl/index.php?/category/21

Offline

 

#11 2015-01-17 17:21:01

plg
Piwigo Team
Location: Nantes, France, Europe
Registered: 2002-04-05
Posts: 13060
Website

Re: [resolved] black and white photos getting brigher with watermark

flop25 wrote:

http://www.imagemagick.org/discourse-server/viewtopic.php?t=21632 ?

nice, thank you :-) I'll see what I can do with that!


Latest blog post (March 23th 2017) Piwigo.com Enterprise plans, now official!

Offline

 

#12 2015-01-17 17:25:12

plg
Piwigo Team
Location: Nantes, France, Europe
Registered: 2002-04-05
Posts: 13060
Website

Re: [resolved] black and white photos getting brigher with watermark

sport wrote:

Is it not in the watermark picture?
i have no problems.
Check http://sportplaatje.nl/index.php?/category/21

Your original photo, even if only showing grays, is in RGB mode, not in grayscale. This is certainly why you have no problem.

Using the grayscale mode on a B&W photo is a good idea because it seriously decreases the file size. For example with the photo of the stone house :

* grayscale = 5.3MB
* RGB = 7.4MB

=> +40%


Latest blog post (March 23th 2017) Piwigo.com Enterprise plans, now official!

Offline

 

#13 2015-01-17 18:35:50

sport
Member
Registered: 2014-03-16
Posts: 74

Re: [resolved] black and white photos getting brigher with watermark

i did just convert a picture to grey-scale in Photo-shop,
and it all looks good when imported to my web-page with the watermark.

I never did now that, so thx for sharing.
Size is no problem, max size on my site is 1024pixels.
But my print shop, always want all in srgb mode, so we keep it that way.

But what i did mean is, is not the watermark the problem off getting a brighter image, What color profile does it have.

I can be completely wrong, i don't have programming skills or knowing how things work in piwigo.
but is it possible that your image and the watermark both have a exif in it.
And if so, what exif info will be read.
ad first there is the picture, and as a overlay the watermark.
i think the overlay is the one from what piwigo reads the exif or the color profile

Offline

 

#14 2016-02-14 20:47:52

plg
Piwigo Team
Location: Nantes, France, Europe
Registered: 2002-04-05
Posts: 13060
Website

Re: [resolved] black and white photos getting brigher with watermark


Latest blog post (March 23th 2017) Piwigo.com Enterprise plans, now official!

Offline

 

Board footer

Powered by FluxBB

github twitter facebook google+ newsletter Donate Piwigo.org © 2002-2017 · Contact