Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"-function polynomial" problem #2404

Closed
snibgo opened this issue Aug 12, 2020 · 3 comments
Closed

"-function polynomial" problem #2404

snibgo opened this issue Aug 12, 2020 · 3 comments

Comments

@snibgo
Copy link

snibgo commented Aug 12, 2020

Prerequisites

  • [y] I have written a descriptive issue title
  • [y] I have verified that I am using the latest version of ImageMagick
  • [y] I have searched open and closed issues to ensure it has not already been reported

Description

"-function polynomial" gives slightly wrong answers on Windows 8.1, 7.0.10-27.

See also my previous report, https://www.imagemagick.org/discourse-server/viewtopic.php?f=3&t=37520

Steps to Reproduce

f:\prose\PICTURES>%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

System Configuration

Windows 8.1.

IM version information:

f:\prose\PICTURES>%IMG7%magick -version
Version: ImageMagick 7.0.10-27 Q16 x64 2020-08-10 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2018 ImageMagick Studio LLC
License: http://www.imagemagick.org/script/license.php
Visual C++: 192628806
Features: Cipher DPC HDRI Modules OpenCL OpenMP(2.0)
Delegates (built-in): bzlib cairo flif freetype gslib heic jng jp2 jpeg lcms lqr
 lzma openexr pangocairo png ps raw rsvg tiff webp xml zlib
@fmw42
Copy link

fmw42 commented Aug 12, 2020

It seems to work fine for me on Mac OSX with IM 7.0.10.27 Q16.

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: (32767.5)  #800080008000  gray(50%)

@snibgo
Copy link
Author

snibgo commented Aug 12, 2020

Thanks, Fred. Yes, this seems to be a Windows-only problem.

@dlemstra
Copy link
Member

dlemstra commented Aug 24, 2020

This appears to be a rounding issue in the OpenCL code. The C codes uses double but the OpenCL code uses float instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants