Your last one should have worked, and does on master. I guess I need to tag a
new version.
This is the most direct, though:
B = reinterpret(BGRA{Ufixed8}, A) # assuming little-endian
imwrite(B, "file.png")
It does seem Color could use some more functions for converting to and from
ARGB32.
--Tim
On Friday, February 13, 2015 08:52:14 AM Christopher Lee wrote:
> I have a Uint32 array, ARGB formatted. How do I convert that back to an
> Image so that I can call imwrite? (The alpha component is unimportant, but
> it would be nice to save it if the file format supports it)
> imagearray = reinterpret(RGB24,imagearray)
> image = Image(imagearray)
> imagearray = reinterpret(Uint8, data(image))
> image = convert(Image{RGB},imagearray)
> does not work, also
> image = colorim(imagearray,"ARGB")
> does not work.
>
> I have tried
> imagearray = reinterpret(RGB24,imagearray)
> image = Image(imagearray)
> image = reinterpret(Uint8, data(image))
> imwrite(image,app.outputimagefilename)
> but that gives a mapinfo error.
> ERROR: `mapinfo` has no method matching mapinfo(::Type{ImageMagick}, ::Image
> {RGB24,2,Array{RGB24,2}})
>
>
> imagearray = reinterpret(RGB24,imagearray)
> image = Image(imagearray)
> imwrite(image,app.outputimagefilename)
> also gives the mapinfo error