Bitmap copy misalignment

Bug #743931 reported by K. Dermitzakis
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Inkscape
New
Undecided
Unassigned

Bug Description

Inkscape 0.48.1, on windows 7

Steps to reproduce:

- Create a new svg, embed the attached gif (same behaviour with png).
- Scale the embedded image to take the space of the whole page (or large enough to be visible, e.g. 600x600)
- Go to preferences and set bitmap oversampling to none (to rule this out)
- select it, and Alt+b
- the bitmap copy is *visibly* misaligned when it shouldnt have been (squares do not retain their shape).

Im sure this is not intended behaviour?

Tags: bitmap
Revision history for this message
K. Dermitzakis (dermitza) wrote :
description: updated
Revision history for this message
su_v (suv-lp) wrote :

Nothing unexpected reproduced with Inkscape 0.48.1 and Inkscape 0.48+devel r10129 on OS X 10.5.8

> Im sure this is not intended behaviour?

Keep in mind that a bitmap copy (which is 1:1 and not scaled) is limited to integer px values (based in Inkscape's internal 90 dpi), unlike the scaled original bitmap image (open the attached document, zoom in (800%), turn on the grid and compare the edges to the scaled bitmap to the 1-px-spaced grid lines).

Revision history for this message
su_v (suv-lp) wrote :

Typo:
- compare the edges to the scaled bitmap to the 1-px-spaced grid lines
+ compare the edges of the scaled bitmap to the 1-px-spaced grid lines

tags: added: bitmap
Revision history for this message
K. Dermitzakis (dermitza) wrote :

- (open the attached document, zoom in (800%), turn on the grid and compare the edges to the scaled bitmap to the 1-px-spaced grid lines).

What am i looking for here?

For the original, each sub-square size is 27.2 grid units (are these pixels ?)
While the bitmap copy is 28.

So load the original and scale it to 44x44 px, bitmap copy works fine.
Now scale it to 42x42. Each square is 1.9 pixels, bitmap copy gets clamped at 2px at 90 dpi, ok.

Change dpi to 120. Not clamped any more, square is now of size 2.20px
Change dpi to 140. 1.95px
Change dpi to 160. 2.30px
Change dpi to 180, 2.00px.

Reducing dpi:

80: 2.25px
60: 3.00px
40: 2.30px
20: 4.68px
10: 10.5px

Are the above results as expected?

Revision history for this message
su_v (suv-lp) wrote :

> (are these pixels ?)

Yes, the grid spacing is 1px, which corresponds to Inkscape's internal 90dpi. Possibly you need to zoom in closer, depending on your zoom preferences and window size.

> Each square is 1.9 pixels, bitmap copy gets clamped at 2px at 90 dpi, ok.
> Change dpi to 120. Not clamped any more, square is now of size 2.20px

With increased (or decreased) DPI, the bitmap copy is scaled too, like the original. Thus the pixel boundaries of the bitmap copy no longer correspond to the pixel grid (i.e. the bitmap copy no longer _appears_ to be clamped at integer px values).
Compare the real image size as noted in the status bar (varies depending on DPI set for the bitmap copy), to the size of the bitmap copy as displayed in the width/height controls of the select tool (stays - in your example - at 42x42 px for each bitmap copy, regardless of DPI).

In the attached archive, I extracted the bitmap copies made with varying DPIs - if you view them externally (or import them into Inkscape), you'll see that the effective size of the bitmap image varies, and depending on the amount of available pixels, the scaled original image is approximated.

> Are the above results as expected?
AFAIU, yes - but honestly I'm not sure I understand what you actually expect.

@JazzyNico - what's your take on this issue?

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.