-
Notifications
You must be signed in to change notification settings - Fork 143
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
Error using imwrite to write an array of AlphaColorValues where an array of RGB{Ufixed8}s succeeds #200
Comments
For this fix to work, you'll also need to say |
This is awesome. Wasn't expecting a reply so quickly – thanks! I seem to still be having trouble getting my code to work, though. I've updated Images.jl and checked out the master branch of |
Oh hang on, I think I'm saving these as |
Yep. That was it. :-) Maybe rather than implicitly dropping an entire channel of the image it should throw an error, and ask that you explicitly specify that you want to do something more like coercing than converting? That would make sense for my use and I wonder if it would be helpful in general. |
You caught me at a good time; it had been days since I'd had a moment to address issues. Making this an error could be a bit tricky; it depends on the file format, and ImageMagick handles all the details of the file format. If you have any good ideas, I'd be happy to entertain a pull request. Also, any progress on this is currently hampered by JuliaLang/julia#8618, which seems to prevent direct coercion. BTW, I tagged a new version of Color, so you can |
In Julia 3.1 on OS X and the latest version of Images.jl, I have a 2d array of (Uint8, Uint8, Uint8) that I want to save to a file as an image.
When I do
imwrite(map(tuple2rgb, canvas.colors),"out.png"))
everything is fine, but when I tryimwrite(map(tuple2rgba, canvas.colors),"out.png"))
I get the following error:ERROR:
map
has no method matching map(::MapNone{AlphaColorValue{BGR{UfixedBase{Uint8,8}},UfixedBase{Uint8,8}}}, ::AlphaColorValue{RGB{UfixedBase{Uint8,8}},UfixedBase{Uint8,8}})in map! at /Users/yurivish/.julia/v0.3/Images/src/map.jl:336
in map at /Users/yurivish/.julia/v0.3/Images/src/map.jl:307
in image2wand at /Users/yurivish/.julia/v0.3/Images/src/io.jl:292
in imwrite at /Users/yurivish/.julia/v0.3/Images/src/io.jl:163
I've tried playing around with providing different types for the alpha parameter but nothing seems to work. Is this the right way to save an array of transparent colors?
The text was updated successfully, but these errors were encountered: