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

Bad colors when writing a pix in OSX #248

Closed
60-hz opened this issue Apr 8, 2020 · 10 comments
Closed

Bad colors when writing a pix in OSX #248

60-hz opened this issue Apr 8, 2020 · 10 comments

Comments

@60-hz
Copy link
Contributor

60-hz commented Apr 8, 2020

Colors channels looks wrong when writing a file to disk using [pix_write], [pix_writer] and [pix_buffer] objets in OSX.

Source pict:
RGB_source
Result of pix_write:
RGB_export

OSX 10.13.6
pd-0.50.2
GEM: ver: 0.94.git v0.94
GEM: compiled on Feb 12 2019

Tried in ubuntu and colors are ok.

@unknownError
Copy link

can confirm the issue here. same happens on OSX 10.15.2, gem installed through deken on pd vanilla 0.50-2

@umlaeute
Copy link
Owner

hrmpf. i'm pretty sure i had fixed this...

@umlaeute
Copy link
Owner

could you please check the actual format of your images? (JPEG, TIFF, SGI,...)
also it would be helpful to get a minimal example that triggers the problem.

(there are multiple different image backends involved)

@60-hz
Copy link
Contributor Author

60-hz commented Mar 27, 2023

I tried [pix_write] with the master build from d2b7279 under MacOS and (most reliable) [gemglfw3window] window manager.
Here is an exemple with a file output with each backends.
It looks like that TIFF is upside down and all backends have color issues.

pix_write_MacOS_test.zip

@umlaeute
Copy link
Owner

umlaeute commented Mar 27, 2023

which writer backends are you using?

here it says on startup:

GEM: image saving plugins: STB magick

(so i have two image saving backends)

and, if I start Pd with -verbose -verbose (twice! so you really have to add the flags manually) and set the log-level to "4 all" it says (when saving an image) something like:

trying saver[1]=magick / 101.500000

indicating that it is using the magick backend for saving images.

EDIT here being on Linux using Gem-0.94...

@60-hz
Copy link
Contributor Author

60-hz commented Mar 27, 2023

Strange, "-verbose" flag don't work on my pd 0.53-1

/Applications/Pd-0.53-1.app/Contents/MacOS/Pd -verbose unknown option: -verbose while executing "opt_parser::get_options $argv" (procedure "parse_args" line 7) invoked from within "parse_args $argc $argv" (procedure "main" line 10) invoked from within "main $::argc $::argv" (file "/Applications/Pd-0.53-1.app/Contents/Resources/Scripts/pd-gui.tcl" line 870) invoked from within "source [file join [file dirname [info script]] pd-gui.tcl]"

I found that it works only with Pd 0.53.2...
After few quarantine issues under MacOS ( :/ ) I can finally launch pd with -verbose -verbose... but then Gem lib failed to load!

So all I have right now is:
GEM: image saving plugins: SGI STB imageIO jpeg tiff

@umlaeute
Copy link
Owner

How do you add the -verbose flags? They have to be passed to the pd-core, and you seem to be passing them to the pd-gui.
Either:

  • add them to the "flags" in the startup preferences (iirc, currently afk)
  • launch Pd from the cmdline with /Applications/Pd-0.53-1.app/Contents/Resources/bin/pd -verbose -verbose

@60-hz
Copy link
Contributor Author

60-hz commented Mar 27, 2023

launch Pd from the cmdline with /Applications/Pd-0.53-1.app/Contents/Resources/bin/pd -verbose -verbose

That's the way I always do yes...

add them to the "flags" in the startup preferences (iirc, currently afk)

Oh, I forgot this way thanks... so here is the print:

trying to add 'SGI' as backend
added backend#0 'SGI' @ 0x600002317088
trying to add 'STB' as backend
added backend#1 'STB' @ 0x6000023160a8
trying to add 'imageIO' as backend
added backend#2 'imageIO' @ 0x600002316138
trying to add 'jpeg' as backend
added backend#3 'jpeg' @ 0x600002316898
trying to add 'tiff' as backend
added backend#4 'tiff' @ 0x600002316128

When I save with TIFF:
trying saver[4]=tiff / 100.000000

And when I save with JPEG:
trying saver[3]=jpeg / 101.000000

@umlaeute
Copy link
Owner

it seems that the TIFF and JPEG backends behave worst, STB and imageIO are better (and can handle more formats).

you could just remove the gem_imageTIFF.so and gem_imageJPEG.so files to not use them.

in any case, i've rebooted this issue as #346 (there are other issues as well, even on Linux!)

@60-hz
Copy link
Contributor Author

60-hz commented Mar 28, 2023

you could just remove the gem_imageTIFF.so and gem_imageJPEG.so files to not use them.

indeed! So simple fix...
Maybe it's better not to include those backends in MacOS for the moment, or it would be nice to be able to choose backends from the patch?

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

No branches or pull requests

3 participants