FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Gentoo > Gentoo User

 
 
LinkBack Thread Tools
 
Old 05-04-2011, 11:06 PM
Sebastian Pipping
 
Default Cmdline image resizer understanding gamma ?

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
 
Old 05-05-2011, 05:48 PM
Paul Hartman
 
Default Cmdline image resizer understanding gamma ?

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.
 
Old 05-05-2011, 05:52 PM
Paul Hartman
 
Default Cmdline image resizer understanding gamma ?

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.
 
Old 05-05-2011, 09:25 PM
Sebastian Pipping
 
Default Cmdline image resizer understanding gamma ?

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
 
Old 05-05-2011, 10:05 PM
Paul Hartman
 
Default Cmdline image resizer understanding gamma ?

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.
 
Old 05-06-2011, 03:06 AM
Kfir Lavi
 
Default Cmdline image resizer understanding gamma ?

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
 
Old 05-08-2011, 04:10 PM
Sebastian Pipping
 
Default Cmdline image resizer understanding gamma ?

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
 
Old 05-08-2011, 05:22 PM
Sebastian Pipping
 
Default Cmdline image resizer understanding gamma ?

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
 
Old 05-09-2011, 02:31 PM
Sebastian Pipping
 
Default Cmdline image resizer understanding gamma ?

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
 
Old 05-18-2011, 06:40 PM
Sebastian Pipping
 
Default Cmdline image resizer understanding gamma ?

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
 

Thread Tools




All times are GMT. The time now is 01:28 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org