public inbox for gentoo-user@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-user] Cmdline image resizer understanding gamma ?
@ 2011-05-04 23:06 Sebastian Pipping
  2011-05-05 17:48 ` Paul Hartman
  2011-05-18 18:40 ` Sebastian Pipping
  0 siblings, 2 replies; 10+ messages in thread
From: Sebastian Pipping @ 2011-05-04 23:06 UTC (permalink / raw
  To: gentoo-user

Hello!


I stumbled upon the article

  Gamma error in picture scaling
  http://www.4p8.com/eric.brasseur/gamma.html#Use_a_correct_software

recently.  I was actually pointed to it be some tool applying the proper
algortihm.  I think it was command line.

Especially as I don't trust ImageMagick with files that matter I would
love to find (or re-find) a command line tool that properly handles
Gamma when resizing images.  Needs be free software.  Anyone?

Thanks,



Sebastian



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [gentoo-user] Cmdline image resizer understanding gamma ?
  2011-05-04 23:06 [gentoo-user] Cmdline image resizer understanding gamma ? Sebastian Pipping
@ 2011-05-05 17:48 ` Paul Hartman
  2011-05-05 17:52   ` Paul Hartman
  2011-05-05 21:25   ` Sebastian Pipping
  2011-05-18 18:40 ` Sebastian Pipping
  1 sibling, 2 replies; 10+ messages in thread
From: Paul Hartman @ 2011-05-05 17:48 UTC (permalink / raw
  To: gentoo-user

On Wed, May 4, 2011 at 6:06 PM, Sebastian Pipping <sping@gentoo.org> wrote:
> Hello!
>
>
> I stumbled upon the article
>
>  Gamma error in picture scaling
>  http://www.4p8.com/eric.brasseur/gamma.html#Use_a_correct_software
>
> recently.  I was actually pointed to it be some tool applying the proper
> algortihm.  I think it was command line.

> Especially as I don't trust ImageMagick with files that matter I would
> love to find (or re-find) a command line tool that properly handles
> Gamma when resizing images.  Needs be free software.  Anyone?

ImageMagick works. I downloaded the Dalai Lama photo from that page
and converted it by doing:

convert -colorspace sRGB gamma_dalai_lama_gray.jpg -scale 50%% -set
colorspace sRGB gamma_dalai_lama_gray50.png

And the resulting image is correct.



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [gentoo-user] Cmdline image resizer understanding gamma ?
  2011-05-05 17:48 ` Paul Hartman
@ 2011-05-05 17:52   ` Paul Hartman
  2011-05-05 21:25   ` Sebastian Pipping
  1 sibling, 0 replies; 10+ messages in thread
From: Paul Hartman @ 2011-05-05 17:52 UTC (permalink / raw
  To: gentoo-user

On Thu, May 5, 2011 at 12:48 PM, Paul Hartman
<paul.hartman+gentoo@gmail.com> wrote:
> On Wed, May 4, 2011 at 6:06 PM, Sebastian Pipping <sping@gentoo.org> wrote:
>> Hello!
>>
>>
>> I stumbled upon the article
>>
>>  Gamma error in picture scaling
>>  http://www.4p8.com/eric.brasseur/gamma.html#Use_a_correct_software
>>
>> recently.  I was actually pointed to it be some tool applying the proper
>> algortihm.  I think it was command line.
>
>> Especially as I don't trust ImageMagick with files that matter I would
>> love to find (or re-find) a command line tool that properly handles
>> Gamma when resizing images.  Needs be free software.  Anyone?
>
> ImageMagick works. I downloaded the Dalai Lama photo from that page
> and converted it by doing:
>
> convert -colorspace sRGB gamma_dalai_lama_gray.jpg -scale 50%% -set
> colorspace sRGB gamma_dalai_lama_gray50.png
>
> And the resulting image is correct.

I will add the disclaimer that it *appears* correct to me. It is not a
solid grey image like the "bad" examples on that page. I don't fully
understand what that page is talking about and most of it was a
whooosh over my head. :)



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [gentoo-user] Cmdline image resizer understanding gamma ?
  2011-05-05 17:48 ` Paul Hartman
  2011-05-05 17:52   ` Paul Hartman
@ 2011-05-05 21:25   ` Sebastian Pipping
  2011-05-05 22:05     ` Paul Hartman
  2011-05-06  3:06     ` Kfir Lavi
  1 sibling, 2 replies; 10+ messages in thread
From: Sebastian Pipping @ 2011-05-05 21:25 UTC (permalink / raw
  To: gentoo-user

On 05/05/2011 07:48 PM, Paul Hartman wrote:
>> Especially as I don't trust ImageMagick with files that matter I would
>> love to find (or re-find) a command line tool that properly handles
>> Gamma when resizing images.  Needs be free software.  Anyone?
> 
> ImageMagick works. I downloaded the Dalai Lama photo from that page
> and converted it by doing:
> 
> convert -colorspace sRGB gamma_dalai_lama_gray.jpg -scale 50%% -set
> colorspace sRGB gamma_dalai_lama_gray50.png
> 
> And the resulting image is correct.

As I said, I do not trust ImageMagick with quality.  I am looking for a
different tool.



Sebastian



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [gentoo-user] Cmdline image resizer understanding gamma ?
  2011-05-05 21:25   ` Sebastian Pipping
@ 2011-05-05 22:05     ` Paul Hartman
  2011-05-08 16:10       ` Sebastian Pipping
  2011-05-06  3:06     ` Kfir Lavi
  1 sibling, 1 reply; 10+ messages in thread
From: Paul Hartman @ 2011-05-05 22:05 UTC (permalink / raw
  To: gentoo-user

On Thu, May 5, 2011 at 4:25 PM, Sebastian Pipping <sping@gentoo.org> wrote:
> On 05/05/2011 07:48 PM, Paul Hartman wrote:
>>> Especially as I don't trust ImageMagick with files that matter I would
>>> love to find (or re-find) a command line tool that properly handles
>>> Gamma when resizing images.  Needs be free software.  Anyone?
>>
>> ImageMagick works. I downloaded the Dalai Lama photo from that page
>> and converted it by doing:
>>
>> convert -colorspace sRGB gamma_dalai_lama_gray.jpg -scale 50%% -set
>> colorspace sRGB gamma_dalai_lama_gray50.png
>>
>> And the resulting image is correct.
>
> As I said, I do not trust ImageMagick with quality.  I am looking for a
> different tool.

Doesn't Netpbm satisfy your criteria? It's the very first program on
the list of "good" software in that web page.



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [gentoo-user] Cmdline image resizer understanding gamma ?
  2011-05-05 21:25   ` Sebastian Pipping
  2011-05-05 22:05     ` Paul Hartman
@ 2011-05-06  3:06     ` Kfir Lavi
  2011-05-08 17:22       ` Sebastian Pipping
  2011-05-09 14:31       ` Sebastian Pipping
  1 sibling, 2 replies; 10+ messages in thread
From: Kfir Lavi @ 2011-05-06  3:06 UTC (permalink / raw
  To: gentoo-user

[-- Attachment #1: Type: text/plain, Size: 778 bytes --]

On Fri, May 6, 2011 at 12:25 AM, Sebastian Pipping <sping@gentoo.org> wrote:

> On 05/05/2011 07:48 PM, Paul Hartman wrote:
> >> Especially as I don't trust ImageMagick with files that matter I would
> >> love to find (or re-find) a command line tool that properly handles
> >> Gamma when resizing images.  Needs be free software.  Anyone?
> >
> > ImageMagick works. I downloaded the Dalai Lama photo from that page
> > and converted it by doing:
> >
> > convert -colorspace sRGB gamma_dalai_lama_gray.jpg -scale 50%% -set
> > colorspace sRGB gamma_dalai_lama_gray50.png
> >
> > And the resulting image is correct.
>
> As I said, I do not trust ImageMagick with quality.  I am looking for a
> different tool.
>
>
>
> Sebastian
>
> What about using gimp in scripting mode?

Kfir

[-- Attachment #2: Type: text/html, Size: 1227 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [gentoo-user] Cmdline image resizer understanding gamma ?
  2011-05-05 22:05     ` Paul Hartman
@ 2011-05-08 16:10       ` Sebastian Pipping
  0 siblings, 0 replies; 10+ messages in thread
From: Sebastian Pipping @ 2011-05-08 16:10 UTC (permalink / raw
  To: gentoo-user

On 05/06/2011 12:05 AM, Paul Hartman wrote:
> Doesn't Netpbm satisfy your criteria? It's the very first program on
> the list of "good" software in that web page.

I have a had a closer look at netpbm's pamscale now.


pamscale doesn't support PNG input out of the box:

  "pamscale: bad magic number 0x8950 - not a PAM, PPM, PGM, or PBM file"

So to let pamscale operate on my PNG it seems I would need to run this

  # pngtopam in.png > in.pam
  # pamscale [..] in.pam > out.pam
  # pamtopnm out.pam > out.pnm
  # pnmtopng out.pnm > out.png

I haven't checked yet if that preserves transparency.

While there is a tool pamrgbatopng shipped with netpbm it didn't like my
out.pam produced above:

  "pamrgbatopng: PAM must have depth at least 4 (red, green, blue,
   alpha).  This one has depth 3"

Interestingly netpbm tools point to a respective man page when run with
--help, which points to a man-like website with the real content.  So it
seems without internet the tool is effectively unusable.  Great.

I'm also not sure if I really want to add 300 binary files from a single
package:

  # equery f media-libs/netpbm | grep '^/usr/bin' | wc -l
  331

Best,



Sebastian



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [gentoo-user] Cmdline image resizer understanding gamma ?
  2011-05-06  3:06     ` Kfir Lavi
@ 2011-05-08 17:22       ` Sebastian Pipping
  2011-05-09 14:31       ` Sebastian Pipping
  1 sibling, 0 replies; 10+ messages in thread
From: Sebastian Pipping @ 2011-05-08 17:22 UTC (permalink / raw
  To: gentoo-user

On 05/06/2011 05:06 AM, Kfir Lavi wrote:
> What about using gimp in scripting mode?

There seems to be options on Scheme, Python and Lua (Gimp plug-in "gluas").

Eric Brasseur (the author of the article on Gamma) offers a Lua script
for gluas, which is why I wrote an ebuild for gluas now:

  # sudo layman -a betagarden
  # sudo emerge -av media-plugins/gimp-gluas

The script throws an error in my setup though, that I am not able to fix
myself quickly.  I have just contacted Eric about it.


I have not looked into the Scheme and Python options yet.

Best,



Sebastian



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [gentoo-user] Cmdline image resizer understanding gamma ?
  2011-05-06  3:06     ` Kfir Lavi
  2011-05-08 17:22       ` Sebastian Pipping
@ 2011-05-09 14:31       ` Sebastian Pipping
  1 sibling, 0 replies; 10+ messages in thread
From: Sebastian Pipping @ 2011-05-09 14:31 UTC (permalink / raw
  To: gentoo-user

On 05/06/2011 05:06 AM, Kfir Lavi wrote:
> What about using gimp in scripting mode?

I've been working on a pygimp-based plugin for the GIMP yesterday.

It's a bit slow but it does the job, and comes with a simple GUI [1].
After running

  # sudo layman -a betagarden
  # sudo emerge -av media-plugins/gimp-imagescaler

you should find an item

  "Scale Image with correct Gamma..."

at the bottom of the "Image" menu as seen on [2].
The sources are up at [3].

Best,



Sebastian


[1] https://blog.hartwork.org/__images/imagescalerplugin-dialog-332x395.png
[2] https://blog.hartwork.org/__images/imagescalerplugin-menu-394x449.png
[3] http://git.goodpoint.de/?p=imagescaler.git;a=summary



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [gentoo-user] Cmdline image resizer understanding gamma ?
  2011-05-04 23:06 [gentoo-user] Cmdline image resizer understanding gamma ? Sebastian Pipping
  2011-05-05 17:48 ` Paul Hartman
@ 2011-05-18 18:40 ` Sebastian Pipping
  1 sibling, 0 replies; 10+ messages in thread
From: Sebastian Pipping @ 2011-05-18 18:40 UTC (permalink / raw
  To: gentoo-user

On 05/05/2011 01:06 AM, Sebastian Pipping wrote:
> I stumbled upon the article
> 
>   Gamma error in picture scaling
>   http://www.4p8.com/eric.brasseur/gamma.html#Use_a_correct_software
> 
> recently.  I was actually pointed to it be some tool applying the proper
> algortihm.  I think it was command line.

In the meantime a person called Jure kindly pointed me to

  media-gfx/imageworsener

now, which is what I initially was looking for.

Best,



Sebastian



^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2011-05-18 18:42 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-05-04 23:06 [gentoo-user] Cmdline image resizer understanding gamma ? Sebastian Pipping
2011-05-05 17:48 ` Paul Hartman
2011-05-05 17:52   ` Paul Hartman
2011-05-05 21:25   ` Sebastian Pipping
2011-05-05 22:05     ` Paul Hartman
2011-05-08 16:10       ` Sebastian Pipping
2011-05-06  3:06     ` Kfir Lavi
2011-05-08 17:22       ` Sebastian Pipping
2011-05-09 14:31       ` Sebastian Pipping
2011-05-18 18:40 ` Sebastian Pipping

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox