Hello, I have spent the past 5 hours going around in circles with this...
I am trying to get the canvas size to match my object/image. I select all layers and size my image appropriately. I then go into document properties and scale the canvas size to the exact same proportions. Then I click 'resize page to content' (and i have tried other directions and fiddling in here) and then... what happens is my image loses some of its formatting - it loses some colour/texture. Why won't my drawing stay exactly as it was - the only thing i had done was change the canvas size.
Not only that, but the canvas size is still a little larger on the top and right hand side. It seems also that some times my image and/or canvas will change to whatever size it wants at times, changing by just a few pixels...
My primary concern is 1) why did i lose formatting and how can i keep it? and 2) why does it have to be so difficult to get the canvas size matched with the image? I have followed the instructions of many relevant posts and still no luck. Alternatively, can I just make the canvas invisible on the final doc?
Thanks so much for any help, I'm truly beyond frustrated with this problem which seems to make no sense to me...
Canvas and Image Sizing Problems
Re: Canvas and Image Sizing Problems
Welcome to InkscapeForum!
It's not difficult to get the canvas size to match the drawing. But it does sound like you might be adding an extra step or 2. You should not be losing any formatting or content though. I wonder if you might not have had everything selected when you first scaled the drawing. That might make it appear that things have moved. And if you use Resize page to content, everything might move. There are some settings which might help as well. And also, if you didn't scale in proportion, it might also seem like sizes were changing. I'm not sure where to start, because there are several comments I'd like to make. I'll just start with scaling (resizing) and move on from there.
The first thing to do, if you need to resize the whole drawing, is make sure that everything is selected. If you're using layers, make sure you have all the layers visible that contain parts of the drawing, and others which don't have parts of the final drawing should be hidden. If you don't have any pieces outside the page border (which sometimes people will leave things outside the border, for convenience while working, that won't be seen in certain circumstances, when the drawing is finished) you can use Ctrl + A, which is Select All (or Edit menu > Select All). It's so much easier than selecting one at a time, or sometimes even easier than dragging a selection box (because if you don't drag far enough outside objects with blur or other filters, they won't be selected). If you do have things outside the page border, you could put them in a hidden layer, to make selecting easier. Or you can stick with dragging the selection box. But if you have any objects with blurring or other filters, select them individually first, so you can notice how far outside the object its bounding box lies. Then be sure to drag the selection box a little bit further away. You can zoom out, to make it easier, if the drawing fills the whole screen.
On the far right side of the Selection tool control bar are 4 similar looking buttons. The first one is 'When scaling objects, scale stroke width by the same proportion'. That means that if you scale (resize) an object, the stroke width will change too, which makes the object a little larger (or smaller). This is usually the culprit when objects sizes mysteriously change by a few pixels, or fractions or pixels. Personally I have that button disengaged most of the time. The next one is 'When scaling rectangles, scale the radii of rounded corners'. So if your drawing uses any rounded rectangles, and you don't want the size to change....actually I'm not sure, since I hardly ever use rounded rectangles. I'm thinking you would not want the radii to change. The next one, 'Move gradients along with objects' allows the gradient to move along with the object. I don't know why one would ever not want the gradient to move with the object, but if that button is disengaged, and you use Resize canvas to content, the gradient might stay behind. And the 4th one is the same as the 3rd, except it applies to pattern fills. So to keep sizes from changing or fills from getting separated, you'll want to have the first 2 buttons disengaged, and the last 2 engaged.
Once you have those set, and you either know where to drag the selection box, or use Select All, you'll be ready to scale. There are a couple of ways to scale. One is using the Selection tool, and grabbing one of the corner arrows and dragging. Be sure to hold the Ctrl key to keep in proportion. Scaling is done towards the top and right, unless you hold Shift key. So Ctrl + Shift + drag will do a perfect scale, using Selection tool. However, you might be needing a specific size. If that's the case, you can use the H and W values on the Selection tool control bar. Be sure to click the tiny padlock icon between H and W, to keep in proportion. The other way to scale is using Object menu > Transform > Scale. If you're using a recent version of Inkscape, it will scale from the center. But be sure to check the Scale Proportionally box.
Now we finally get to the canvas size. If you've done everything else properly, all you need to do is Select All, then open Document Properties and click Resize to Content. If you like, you can put an empty margin between the drawing and the new canvas. Oh, or actually....yeah, this is new since 0.48. You don't even have to Select All, if everything visible will be the final drawing. The button says "Resize page to drawing or selection" which implies to me that everything doesn't have to be selected. I just noticed the wording the other day, and I just now tried it. So if you don't have any extra bits left over, that aren't meant to be part of the final drawing, you can skip the selection and just click the "Resize...." button. But you do still have to select for the scaling.
Oops, I missed your question about an invisible canvas until now. The Inkscape canvas is transparent by default. So unless you change it, it will remain "invisible". Unless you mean that you don't want to see the page border. You can hide the page border at the bottom of Document Properties > Page tab. However, just hiding it may not solve your problem. If the drawing isn't all inside the page border, it might not show in certain circumstance. For example, on certain webpages, only what's inside the page border will show, or some viewers also might only show what's inside the page border.
If you're planning to use File menu > Export Bitmap, to create a PNG, you don't need to worry about the page/canvas size. You can export using the Drawing option, and as long as the page border isn't visible, it won't matter whether the image is inside the borders or not.
So I think that about covers everything I can think of. If you've made sure about all the details I've covered, and you still have trouble, let us know. Well get it figured out eventually
It's not difficult to get the canvas size to match the drawing. But it does sound like you might be adding an extra step or 2. You should not be losing any formatting or content though. I wonder if you might not have had everything selected when you first scaled the drawing. That might make it appear that things have moved. And if you use Resize page to content, everything might move. There are some settings which might help as well. And also, if you didn't scale in proportion, it might also seem like sizes were changing. I'm not sure where to start, because there are several comments I'd like to make. I'll just start with scaling (resizing) and move on from there.
The first thing to do, if you need to resize the whole drawing, is make sure that everything is selected. If you're using layers, make sure you have all the layers visible that contain parts of the drawing, and others which don't have parts of the final drawing should be hidden. If you don't have any pieces outside the page border (which sometimes people will leave things outside the border, for convenience while working, that won't be seen in certain circumstances, when the drawing is finished) you can use Ctrl + A, which is Select All (or Edit menu > Select All). It's so much easier than selecting one at a time, or sometimes even easier than dragging a selection box (because if you don't drag far enough outside objects with blur or other filters, they won't be selected). If you do have things outside the page border, you could put them in a hidden layer, to make selecting easier. Or you can stick with dragging the selection box. But if you have any objects with blurring or other filters, select them individually first, so you can notice how far outside the object its bounding box lies. Then be sure to drag the selection box a little bit further away. You can zoom out, to make it easier, if the drawing fills the whole screen.
On the far right side of the Selection tool control bar are 4 similar looking buttons. The first one is 'When scaling objects, scale stroke width by the same proportion'. That means that if you scale (resize) an object, the stroke width will change too, which makes the object a little larger (or smaller). This is usually the culprit when objects sizes mysteriously change by a few pixels, or fractions or pixels. Personally I have that button disengaged most of the time. The next one is 'When scaling rectangles, scale the radii of rounded corners'. So if your drawing uses any rounded rectangles, and you don't want the size to change....actually I'm not sure, since I hardly ever use rounded rectangles. I'm thinking you would not want the radii to change. The next one, 'Move gradients along with objects' allows the gradient to move along with the object. I don't know why one would ever not want the gradient to move with the object, but if that button is disengaged, and you use Resize canvas to content, the gradient might stay behind. And the 4th one is the same as the 3rd, except it applies to pattern fills. So to keep sizes from changing or fills from getting separated, you'll want to have the first 2 buttons disengaged, and the last 2 engaged.
Once you have those set, and you either know where to drag the selection box, or use Select All, you'll be ready to scale. There are a couple of ways to scale. One is using the Selection tool, and grabbing one of the corner arrows and dragging. Be sure to hold the Ctrl key to keep in proportion. Scaling is done towards the top and right, unless you hold Shift key. So Ctrl + Shift + drag will do a perfect scale, using Selection tool. However, you might be needing a specific size. If that's the case, you can use the H and W values on the Selection tool control bar. Be sure to click the tiny padlock icon between H and W, to keep in proportion. The other way to scale is using Object menu > Transform > Scale. If you're using a recent version of Inkscape, it will scale from the center. But be sure to check the Scale Proportionally box.
Now we finally get to the canvas size. If you've done everything else properly, all you need to do is Select All, then open Document Properties and click Resize to Content. If you like, you can put an empty margin between the drawing and the new canvas. Oh, or actually....yeah, this is new since 0.48. You don't even have to Select All, if everything visible will be the final drawing. The button says "Resize page to drawing or selection" which implies to me that everything doesn't have to be selected. I just noticed the wording the other day, and I just now tried it. So if you don't have any extra bits left over, that aren't meant to be part of the final drawing, you can skip the selection and just click the "Resize...." button. But you do still have to select for the scaling.
Oops, I missed your question about an invisible canvas until now. The Inkscape canvas is transparent by default. So unless you change it, it will remain "invisible". Unless you mean that you don't want to see the page border. You can hide the page border at the bottom of Document Properties > Page tab. However, just hiding it may not solve your problem. If the drawing isn't all inside the page border, it might not show in certain circumstance. For example, on certain webpages, only what's inside the page border will show, or some viewers also might only show what's inside the page border.
If you're planning to use File menu > Export Bitmap, to create a PNG, you don't need to worry about the page/canvas size. You can export using the Drawing option, and as long as the page border isn't visible, it won't matter whether the image is inside the borders or not.
So I think that about covers everything I can think of. If you've made sure about all the details I've covered, and you still have trouble, let us know. Well get it figured out eventually

Basics - Help menu > Tutorials
Manual - Inkscape: Guide to a Vector Drawing Program
Inkscape Community - Inkscape FAQ - Gallery
Inkscape for Cutting Design
Manual - Inkscape: Guide to a Vector Drawing Program
Inkscape Community - Inkscape FAQ - Gallery
Inkscape for Cutting Design
- flamingolady
- Posts: 687
- Joined: Wed Jun 10, 2009 1:40 pm
Re: Canvas and Image Sizing Problems
First of all, just have to say, love your avi name... : )
Brynn, really good info, may I suggest that write this up as some sort of a FAQ? so others can make good use of it (this will get buried in time).
What's funny, is that I've not ever had this type of issue - until last night, and have spent the last 1/2 hr trying to get the pixels right with the canvas size (less than a pixel off, which is driving me insane), so this topic happened to have come at a great time!
I really didn't have anything to add, as Brynn is very thorough in her response.
Brynn, really good info, may I suggest that write this up as some sort of a FAQ? so others can make good use of it (this will get buried in time).
What's funny, is that I've not ever had this type of issue - until last night, and have spent the last 1/2 hr trying to get the pixels right with the canvas size (less than a pixel off, which is driving me insane), so this topic happened to have come at a great time!
I really didn't have anything to add, as Brynn is very thorough in her response.
Re: Canvas and Image Sizing Problems
I'm not sure if microUgly would want to make another FAQ (I've tried with much more common problems). But all the info will be searchable, using the forum search (or google, for that matter), no matter how old it gets.
Basics - Help menu > Tutorials
Manual - Inkscape: Guide to a Vector Drawing Program
Inkscape Community - Inkscape FAQ - Gallery
Inkscape for Cutting Design
Manual - Inkscape: Guide to a Vector Drawing Program
Inkscape Community - Inkscape FAQ - Gallery
Inkscape for Cutting Design