Rotation changes the bit depth from 1bit to 8bit

Ask for help and post your question on how to use XnView Classic.

Moderators: XnTriq, xnview

Post Reply
User avatar
dma_k
Posts: 79
Joined: Tue Apr 14, 2009 8:50 am

Rotation changes the bit depth from 1bit to 8bit

Post by dma_k » Fri Sep 09, 2011 12:14 am

I have noticed that when I apply the rotation (Image → Rotate → Custom) to the 1bit (binary) image, it is converted to 8bit. That is unexpected. Is rotation not possible for binary data? It should be even more simpler :)

User avatar
DOS386
Posts: 291
Joined: Sun Jun 11, 2006 2:43 pm

Re: Rotation changes the bit depth from 1bit to 8bit

Post by DOS386 » Fri Sep 09, 2011 9:56 am

dma_k wrote:I have noticed that when I apply the rotation (Image → Rotate → Custom) to the 1bit (binary) image, it is converted to 8bit.
Right, 8 bit greyscale.
That is unexpected. Is rotation not possible for binary data? It should be even more simpler
Rotation of binary pixels is possible, but not interpolation ("Smooth"). If interpolation is desired, the image must be "upgraded". There is still a flaw BTW, the image should be upgraded to 16 bit linear greyscale ... note that 8 bit linear greyscale is not feasible, and doing linear interpolation on 8 bit non-linear brightness is incorrect and causes unnecessary quality and brightness loss.

See http://newsgroup.xnview.com/viewtopic.php?t=19897 why :shock:
There is indeed no WinZIP under my rock.

User avatar
dma_k
Posts: 79
Joined: Tue Apr 14, 2009 8:50 am

Re: Rotation changes the bit depth from 1bit to 8bit

Post by dma_k » Fri Sep 09, 2011 3:34 pm

DOS386 wrote:Rotation of binary pixels is possible, but not interpolation ("Smooth"). If interpolation is desired, the image must be "upgraded". There is still a flaw BTW, the image should be upgraded to 16 bit linear greyscale ... note that 8 bit linear greyscale is not feasible, and doing linear interpolation on 8 bit non-linear brightness is incorrect and causes unnecessary quality and brightness loss.

See http://newsgroup.xnview.com/viewtopic.php?t=19897 why :shock:
I am not sure, what you actually mean for interpolation ("smoothing") during the rotation... Could you be more verbose?

In any case, the image can be automatically converted back to binary after the rotation, right? So what do you think: the current behaviour is OK, or it can/should be improved?

User avatar
DOS386
Posts: 291
Joined: Sun Jun 11, 2006 2:43 pm

Re: Rotation changes the bit depth from 1bit to 8bit

Post by DOS386 » Fri Sep 09, 2011 4:09 pm

not sure, what you actually mean for interpolation ("smoothing") during the rotation... Could you be more verbose?
Try to rotate (by 30 deg maybe) with and without "Smooth" ... check the results.
In any case, the image can be automatically converted back to binary after the rotation, right?
Sure, but this is a lossy conversion and might be usually a bad idea, so it's OFF for now ...
So what do you think: the current behaviour is OK, or it can/should be improved?
The point where I see an urgent need for improvement is to auto convert to 16bppc (thus 64 bpp total for RGBA) linear whenever necessary to do things right (zoom (except NN)), blur, rotate (except NN AKA "non-smooth"), trapez/barrel corrections (not implemented yet), ...). I see no point to keep 1 bpp binary on rotate (except 90 deg).
There is indeed no WinZIP under my rock.

User avatar
XnTriq
Moderator & Librarian
Posts: 5424
Joined: Sun Sep 25, 2005 3:00 am
Location: Ref Desk

Re: Rotation changes the bit depth from 1bit to 8bit

Post by XnTriq » Sat Sep 10, 2011 7:30 pm

dma_k wrote:I am not sure, what you actually mean for interpolation ("smoothing") during the rotation... Could you be more verbose?
Could you post an example, dma_k?

User avatar
dma_k
Posts: 79
Joined: Tue Apr 14, 2009 8:50 am

Re: Rotation changes the bit depth from 1bit to 8bit

Post by dma_k » Mon Sep 12, 2011 9:44 am

DOS386 wrote:Try to rotate (by 30 deg maybe) with and without "Smooth" ... check the results.
I have made a try for this image. I personally see no results for rotation without and with smoothing:

Image Image
DOS386 wrote:
In any case, the image can be automatically converted back to binary after the rotation, right?
Sure, but this is a lossy conversion and might be usually a bad idea, so it's OFF for now ...
Perhaps that could be a preference option ([x] Stay in the same color depth with rotating / zooming the image) or automatically stay in binary when smoothing is OFF?

XnTriq, thank you for links. I understand the principle of anliasing, but for me it makes sense only for non-binary images.

User avatar
xnview
Author of XnView
Posts: 31364
Joined: Mon Oct 13, 2003 7:31 am
Location: France
Contact:

Re: Rotation changes the bit depth from 1bit to 8bit

Post by xnview » Mon Sep 12, 2011 3:10 pm

Yes, to be able to make smooth rotation
Pierre.

User avatar
DOS386
Posts: 291
Joined: Sun Jun 11, 2006 2:43 pm

Re: Rotation changes the bit depth from 1bit to 8bit

Post by DOS386 » Mon Sep 12, 2011 3:22 pm

dma_k wrote:I have made a try for http://dead???files.com/files/7wot0u1d2 this image. I personally see no results for rotation without and with smoothing
Link is dead but rotate works for me, I do get results and they are different. Look better or count colours ;-)
There is indeed no WinZIP under my rock.

User avatar
XnTriq
Moderator & Librarian
Posts: 5424
Joined: Sun Sep 25, 2005 3:00 am
Location: Ref Desk

Re: Rotation changes the bit depth from 1bit to 8bit

Post by XnTriq » Mon Sep 12, 2011 10:00 pm

dma_k wrote:I personally see no results for rotation without and with smoothing:
That's because smoothing is only applied to the preview thumbnail, even if Apply to image is activated :|
You have to confirm with OK to see the difference.
dma_k wrote:XnTriq, thank you for links. I understand the principle of anliasing, but for me it makes sense only for non-binary images.
Not all binary images are created equal ;-)
Please make a few experiments with vision3d05.gif (from Vision3D User Manual).
dma_k wrote:Perhaps that could be a preference option ([x] Stay in the same color depth with rotating / zooming the image) or automatically stay in binary when smoothing is OFF?
In my tests (30° clockwise w/o smoothing) the color depth of Scan001.TIF was't increased :?

User avatar
dma_k
Posts: 79
Joined: Tue Apr 14, 2009 8:50 am

Re: Rotation changes the bit depth from 1bit to 8bit

Post by dma_k » Thu Sep 15, 2011 3:26 pm

XnTriq wrote:In my tests (30° clockwise w/o smoothing) the color depth of Scan001.TIF was't increased :?
Thank you! I have overlooked that if smoothing is off, then the color depth is not changing.

SOLVED

User avatar
Jaff
Posts: 67
Joined: Fri Dec 07, 2007 8:55 am
Location: Romania
Contact:

Re: Rotation changes the bit depth from 1bit to 8bit

Post by Jaff » Sat Sep 17, 2011 2:34 am

Not quite on topic: preview with smoth checked on non 90 degrees rotation show in preview (applied to image) 1 bit image but only when is pressed [OK] button is converted to 8 bit and show real rotated and smoothed image
Imi este indiferent ce cred ceilalti despre mine, caci oricum fiecare crede ce-i convine lui si nu ceea ce e real, doar ca mi-ar fi placut sa ma vada asa cum sint de fapt, nu asa cum poate le-ar placea lor sa creada. Ei au ales deja...

Post Reply