[sane-devel] Converting Raw Image Data to PNG

m. allan noah kitno455 at gmail.com
Fri Jan 10 16:43:08 GMT 2020

Please note that the image could be truly raw data from the scanners
read heads, not like the 'raw' files produced by cameras, which
typically contain lots of meta information about the camera and the
image. The data you get could be scrambled, interlaced, interleaved,
inverted and uncorrected, and (unless it is JPEG) will contain no
header at all. Fortunately, you can open such a file with a good text
editor, and add a PNM header, then tweak the header until you start to
see an image form.

The latter part of this presentation I gave a few years ago shows the
process I use: https://www.youtube.com/watch?v=pJ60vVOKVr0


On Fri, Jan 10, 2020 at 11:05 AM Chris Moller <moller at mollerware.com> wrote:
> ufraw and dcraw will handle that conversion.
> On 10/01/2020 00:09, daniel at pixelgrease.co wrote:
> Hello,
> I have been trying to get a device running for a few weeks now. After failing to build a backend I decided to hack together my own LibUSB driver for my unsupported A8 scanner, given my use case is pretty simple I went in with a "how hard can it be?" attitude.
> Great success so far. Hasn't been easy but it hasn't been really that bad. I have managed to ask my tiny A8 feed scanner to scan a 300dpi colour image. I have been able to save the data to a file (about 8mb worth) but that's where the fun ends.
> Can't seem to figure out how to get that raw data into a usable format. 2 questions:
> 1. What format is that raw data likely to be? I naively expected it to be png.
> 2. Does SANE have some code that handles that sort of conversion I could have a look at? Looked around the internet and the SANE docs. Read some things about frames, but couldn't find much else.
> Daniel

"well, I stand up next to a mountain- and I chop it down with the edge
of my hand"

More information about the sane-devel mailing list