Re: [gentoo-user] Cmdline image resizer understanding gamma ?

2011-05-18 Thread Sebastian Pipping
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



Re: [gentoo-user] Cmdline image resizer understanding gamma ?

2011-05-09 Thread Sebastian Pipping
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



Re: [gentoo-user] Cmdline image resizer understanding gamma ?

2011-05-08 Thread Sebastian Pipping
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



Re: [gentoo-user] Cmdline image resizer understanding gamma ?

2011-05-08 Thread Sebastian Pipping
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



Re: [gentoo-user] Cmdline image resizer understanding gamma ?

2011-05-05 Thread Paul Hartman
On Wed, May 4, 2011 at 6:06 PM, Sebastian Pipping sp...@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.



Re: [gentoo-user] Cmdline image resizer understanding gamma ?

2011-05-05 Thread Paul Hartman
On Thu, May 5, 2011 at 12:48 PM, Paul Hartman
paul.hartman+gen...@gmail.com wrote:
 On Wed, May 4, 2011 at 6:06 PM, Sebastian Pipping sp...@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. :)



Re: [gentoo-user] Cmdline image resizer understanding gamma ?

2011-05-05 Thread Sebastian Pipping
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



Re: [gentoo-user] Cmdline image resizer understanding gamma ?

2011-05-05 Thread Paul Hartman
On Thu, May 5, 2011 at 4:25 PM, Sebastian Pipping sp...@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.



Re: [gentoo-user] Cmdline image resizer understanding gamma ?

2011-05-05 Thread Kfir Lavi
On Fri, May 6, 2011 at 12:25 AM, Sebastian Pipping sp...@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


[gentoo-user] Cmdline image resizer understanding gamma ?

2011-05-04 Thread Sebastian Pipping
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