Bug 240339 - Higher-bit scans are reduced to 8 bit
Summary: Higher-bit scans are reduced to 8 bit
Status: RESOLVED FIXED
Alias: None
Product: Skanlite
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Ubuntu Linux
: NOR wishlist
Target Milestone: ---
Assignee: Kåre Särs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-06-01 12:33 UTC by Sybren Stüvel
Modified: 2010-09-07 23:19 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments
Screenshot of the settings window, showing the possible file formats (33.87 KB, image/png)
2010-06-01 12:33 UTC, Sybren Stüvel
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Sybren Stüvel 2010-06-01 12:33:54 UTC
Created attachment 47550 [details]
Screenshot of the settings window, showing the possible file formats

Version:           unspecified (using KDE 4.4.2) 
OS:                Linux

I'm using an Epson GT-X700 scanner with Skanlite on Kubuntu 10.04. Skanlite supports the scanner, but scanning at more than 8 bit per colour doesn't work. I set up Skanlite like this:

  - Scan source: Transparency Unit
  - Film type: Negative film
  - Scan mode: Grey
  - Bit depth: 16
  - Scan resolution: 600 DPI
  - Focus position: Focus on glass

The scan seems to work as expected, but when it has finished I get this message:

    The image data contained 16 bits per colour, but the colour depth has been truncated to 8 bits per colour.

An 8-bit PNG file is saved, instead of a 16-bit image as I requested. The message doesn't give any indication as to the cause nor the solution. If it is a matter of selecting the correct file format, you can't expect the user to know all details about PNG, BPM and all those other three-letter acronyms. If the user has selected 16-bit and a file format that doesn't support it, this should be reflected in the error message, and the message should be given *before* scanning commences.

XSane works fine with the same scanner and the same settings, and outputs 16-bit TIFF files.

Reproducible: Always

Steps to Reproduce:
Scan at 16 bit per colour.

Actual Results:  
The image data contained 16 bits per colour, but the colour depth has been truncated to 8 bits per colour. No reason is given as to why.

Expected Results:  
Skanlite should have saved a 16-bit image.

On my computer Skanlite supports the following image formats: PNG, JPG, JPEG (what's the difference with JPG?), BMP, PPM, XBM and XPM. I did some digging on Wikipedia, and it seems that none of these formats can actually hold an image with more than 8 bits per colour.

In my opinion any scanning application should at least support output to higher-bit TIFF files. PPM, XBM and XPM aren't used by any graphical designer or photographer, but TIFF is widely used.
Comment 1 Kåre Särs 2010-06-01 22:31:50 UTC
Hi,

The simple answer is that while libksane, the library used by Skanlite, does support 16 bit images, Skanlite, the application does not support 16 bit/color images. This is because it uses Qt's QImage, that only supports 8 bit/color, for saving the images.

Saving 16 bit/color images would require adding more dependencies and more code to Skanlite... patches are welcome :)


The "giving a warning before the actual scan is done" would be possible but I wonder if it is worth the effort as you get the warning after the first 16 bit scan.

I guess this saving 16 bit colors feature could be set a bit higher on the TODO list :)

In the meanwhile you can use the scangui application from kipi-plugins to save with 16 bit colors. A small warning tho: scangui will give the same warning even if the image is saved with 16 bit colors. The warning is given when generating the preview thumbnail...
Comment 2 Sybren Stüvel 2010-06-01 22:46:14 UTC
> The "giving a warning before the actual scan is done" would be possible but
> I wonder if it is worth the effort as you get the warning after the first 16
> bit scan.

The message doesn't indicate the reason. I've tried and re-tried with several different settings before finally giving up. As Skanlite offers to scan in 12-bit, 14-bit and 16-bit, only 25% of the bit depth choices actually work. I'm quite pissed off that I've spent so much time in trying to get it to work, whereas the program's author apparently already knew it wasn't going to work.

So yes, giving a warning "Skanlite does NOT support anything larger than 8 bpp" would be very useful for anybody who tries to get quality scans. I can imagine 8bpp is nice if you want to scan in a drawing or something, but it's far from adequate for photo editing.
Comment 3 Kåre Särs 2010-06-02 09:20:45 UTC
On Tuesday 01 June 2010 23:46:15 Sybren Stüvel wrote:
> https://bugs.kde.org/show_bug.cgi?id=240339
> 
> 
> 
> 
> 
> --- Comment #2 from Sybren Stüvel <sybren stuvel eu>  2010-06-01 22:46:14
> ---
> 
> > The "giving a warning before the actual scan is done" would be possible
> > but I wonder if it is worth the effort as you get the warning after the
> > first 16 bit scan.
> 
> The message doesn't indicate the reason. I've tried and re-tried with
> several different settings before finally giving up. As Skanlite offers to
> scan in 12-bit, 14-bit and 16-bit, only 25% of the bit depth choices
> actually work. I'm quite pissed off that I've spent so much time in trying
> to get it to work, whereas the program's author apparently already knew it
> wasn't going to work.
I'm sorry you feel that way.

BTW: What scanner do you have that provides all those bit depths?

Skanlite/libksane only displays the options that the sane-backend provides and 
very few options, like scan area selection, have special handling. The rest of 
the options are just generic handles to the options provided by the backend.

> 
> So yes, giving a warning "Skanlite does NOT support anything larger than 8
> bpp" would be very useful for anybody who tries to get quality scans. I
> can imagine 8bpp is nice if you want to scan in a drawing or something,
> but it's far from adequate for photo editing.

 I "only" have GIMP for my photo editing and if I'm not mistaken GIMP has not 
been able to use more than 8 bit colors for a very long time. I know it is 
starting to be possible to do something in 16 bit/color mode now, but it is 
not the default...

There is also a technical reason why adding the warning before the scan is not 
trivial. I would have to add a new interface to the library where the 
application states it capabilities. I do not feel that is worth the effort as 
it would be much better to spend the time on adding the 16 bit/color support 
to Skanlite. You are actually the first to explicitly ask for it.
Comment 4 Sybren Stüvel 2010-06-02 09:44:30 UTC
> BTW: What scanner do you have that provides all those bit depths?

Epson Perfection 4870 Pro, a.k.a. GT-X700. It's in the bug report, of course ;-)

> I "only" have GIMP for my photo editing and if I'm not mistaken GIMP has not
> been able to use more than 8 bit colors for a very long time. I know it is 
> starting to be possible to do something in 16 bit/color mode now, but it is 
> not the default...

That's one of the reasons I hardly use GIMP for my photo editing. I use Bibble Pro.

> There is also a technical reason why adding the warning before the scan
> is not trivial.

Why? Can't you just add a warning whenever someone selects anything but "8" from the bit depth drop-down? Should be a matter of connecting a Qt signal to it and you're done.

> it would be much better to spend the time on adding the 16 bit/color support 
> to Skanlite.

Having 16-bit support would be preferable to a better warning that it isn't supported, I agree on that :)

> You are actually the first to explicitly ask for it.

Yeah, most people when they don't get something to work, they just move to other software. Or they start complaining on forums. You'd be surprised at how many people don't even think about contacting the author.
Comment 5 Kåre Särs 2010-09-07 22:02:14 UTC
The 16 bit feature is now (actually ~two months ago) in trunk. I have been waiting for a KDE release of extragear apps, but it has not been done yet...

Unfortunately, the preview image needs to be truncated to 8 bit colors because of QImage and that results in a truncation warning with KDE SC < 4.6.

So from KDE SC 4.6 and Skanlite 0.5 there is support for 16 bit/color PNG.
Comment 6 Sybren Stüvel 2010-09-07 23:19:09 UTC
Excellent, thanks!