Hello, I'm trying to decode an image outputted by tiramisu. This is my current workflow:
tiramisu -j | jq -r '.hints."image-data"' > file.txt
I either manually or automatically using awk -F":" '{print (NF>1)? $NF : ""}' remove the prepending data from the base64 I'm attempting to decode:
640:640:2560:true:8:4:/8fs///H7P//x+z//8fs///H6v//x+r//8fq///H6v//x+r//8fq///H6v/...
to
/8fs///H7P//x+z//8fs///H6v//x+r//8fq///H6v//x+r//8fq///H6v/...
then, I cat the file and plug it into the base64 command:
cat file.txt | base64 -d > image.raw
however, the resulting .raw image file cannot be read, converted, or viewed by any application I've tried to use. The mime type of the file reports application/octet stream, and using imagemagick with either of the following commands results in the subsequent error:
[evan@evan-arch ~]$ magick -size 640x640 -depth 8 rgb:image.raw output.png magick: unexpected end-of-file 'image.raw': No such file or directory @ error/rgb.c/ReadRGBImage/248.
[evan@evan-arch ~]$ magick -size 640x640 -depth 8 -format rgb image.raw output.png magick: Unsupported file format or not RAW file `image.raw' @ error/dng.c/ReadDNGImage/504.
I've attached the base64 encoded file below, while keeping the resolution/alpha/depth data attached in front.
I'm hitting a wall, and don't know what to do next. Any help you provide is greatly appreciated! Thanks for your time.
file2.txt
Hello, I'm trying to decode an image outputted by tiramisu. This is my current workflow:
tiramisu -j | jq -r '.hints."image-data"' > file.txtI either manually or automatically using
awk -F":" '{print (NF>1)? $NF : ""}'remove the prepending data from the base64 I'm attempting to decode:640:640:2560:true:8:4:/8fs///H7P//x+z//8fs///H6v//x+r//8fq///H6v//x+r//8fq///H6v/...to
/8fs///H7P//x+z//8fs///H6v//x+r//8fq///H6v//x+r//8fq///H6v/...then, I cat the file and plug it into the base64 command:
cat file.txt | base64 -d > image.rawhowever, the resulting .raw image file cannot be read, converted, or viewed by any application I've tried to use. The mime type of the file reports application/octet stream, and using imagemagick with either of the following commands results in the subsequent error:
[evan@evan-arch ~]$ magick -size 640x640 -depth 8 rgb:image.raw output.png magick: unexpected end-of-file 'image.raw': No such file or directory @ error/rgb.c/ReadRGBImage/248.[evan@evan-arch ~]$ magick -size 640x640 -depth 8 -format rgb image.raw output.png magick: Unsupported file format or not RAW file `image.raw' @ error/dng.c/ReadDNGImage/504.I've attached the base64 encoded file below, while keeping the resolution/alpha/depth data attached in front.
I'm hitting a wall, and don't know what to do next. Any help you provide is greatly appreciated! Thanks for your time.
file2.txt