-function polynomial

Post any defects you find in the released or beta versions of the ImageMagick software here. Include the ImageMagick version, OS, and any command-line required to reproduce the problem. Got a patch for a bug? Post it here.
Post Reply
snibgo
Posts: 12897
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

-function polynomial

Post by snibgo »

IM pre-built binary, v7.0.8-64, with HDRI, on Windows 8.1.

"-function polynomial" is slightly but significantly wrong. For example:

Code: Select all

f:\web\im>%IMG7%magick xc:gray(50%) +write txt: -function polynomial 1,0 txt:
# ImageMagick pixel enumeration: 1,1,65535,gray
0,0: (32767.5)  #800080008000  gray(50%)
# ImageMagick pixel enumeration: 1,1,65535,gray
0,0: (32211.3)  #7DD37DD37DD3  gray(49.1512%) <=== wrong answer

This worked okay with a home-built v6.9.9-40 HDRI:

Code: Select all

f:\web\im>%IM16f%convert xc:gray(50%) +write txt: -function polynomial 1,0 txt:
# ImageMagick pixel enumeration: 1,1,65535,gray
0,0: (32767.5,32767.5,32767.5)  #800080008000  gray(50%)
# ImageMagick pixel enumeration: 1,1,65535,gray
0,0: (32767.5,32767.5,32767.5)  #800080008000  gray(50%)  <==== correct answer
Edit to add: the same version of IM, but built by me with Gnu C toolset, Q32, works fine:

Code: Select all

f:\web\im>%IM7DEV%magick xc:gray(50%) +write txt: -function polynomial 1,0 txt:
# ImageMagick pixel enumeration: 1,1,4294967295,gray
0,0: (2.14748e+09)  #800000008000000080000000  gray(50%)
# ImageMagick pixel enumeration: 1,1,4294967295,gray
0,0: (2.14748e+09)  #800000008000000080000000  gray(50%)  <==== correct answer
snibgo's IM pages: im.snibgo.com

User avatar
fmw42
Posts: 26261
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: -function polynomial

Post by fmw42 »

It seems to work fine for me with IM 7.0.9.21 Q16 Mac OSX

Code: Select all

magick xc:"gray(50%)" +write txt: -function polynomial 1,0 txt:
# ImageMagick pixel enumeration: 1,1,65535,gray
0,0: (32767.5)  #800080008000  gray(127.5)
# ImageMagick pixel enumeration: 1,1,65535,gray
0,0: (32767.5)  #800080008000  gray(127.5)

Post Reply