Resize image based on fixed dimension w/in image

Post questions on how to use or achieve an effect in Inkscape.
flappypenguin
Posts: 5
Joined: Tue Dec 01, 2015 7:40 pm

Resize image based on fixed dimension w/in image

Postby flappypenguin » Tue Dec 01, 2015 7:48 pm

This question pertains to exported 2D SketchUp files that will be sent to a laser cutter.

The first step is to resize the imported drawing to the correct dimensions so the cutter will cut correctly sized pieces. Usually one would draw a shape of fixed dimension in SketchUp, for example a 4"x4" square, which would then be resized to 4"x4" in Illustrator or whatever interim software is being used to send the image to the cutter.

How would this be accomplished in Inkscape? I can figure out how to transform one side of the square, or how to bit by bit scale the whole drawing so that it gets close to the desired size, but how would I select all, and use the square as a reference to quickly scale the whole drawing?

If there is a simple search term that would lead me to an answer, please just post that and I'll be on my merry way. Thx!

User avatar
brynn
Posts: 10309
Joined: Wed Sep 26, 2007 4:34 pm
Location: western USA
Contact:

Re: Resize image based on fixed dimension w/in image

Postby brynn » Wed Dec 02, 2015 8:27 am

You want to resize a whole image, based on the size of 1 square? There's an extension that will do that, but it's based on the length of a line. As far as I know, it keeps everything in the same proportion. Let me find and I'll post a link.

User avatar
brynn
Posts: 10309
Joined: Wed Sep 26, 2007 4:34 pm
Location: western USA
Contact:

Re: Resize image based on fixed dimension w/in image

Postby brynn » Wed Dec 02, 2015 8:31 am

Ok, well for the record, it should be easy enough to Select All (Ctrl + a) and then scale. Using the Object menu > Transform > Scale dialog, you can do it precisely.

But here's a link to the extension. I needs to be installed though. Do you need instructions?

https://github.com/Moini/inkscape-realscale-extension/

Lazur
Posts: 4717
Joined: Tue Jun 14, 2016 10:38 am

Re: Resize image based on fixed dimension w/in image

Postby Lazur » Wed Dec 02, 2015 10:11 am

Wow that seems a great extension, can't wait to see it as an lpe.
Or something similar.

As a forced solution to the original problem, by adding a transformation matrix/scale to the root layer it should work.
(Viewport and viewbox are defining in the svg how large an object appears in general.)

flappypenguin
Posts: 5
Joined: Tue Dec 01, 2015 7:40 pm

Re: Resize image based on fixed dimension w/in image

Postby flappypenguin » Wed Dec 02, 2015 10:40 am

Brynn, thanks!! That should be exactly what I need. :)

Little speedbump here tho--I've copied the files but the extension does not appear in the Extension menu. I've doublechecked the destination folder and restarted the computer just for kicks. Is there some initialization command I need to send or something?


brynn wrote:Ok, well for the record, it should be easy enough to Select All (Ctrl + a) and then scale. Using the Object menu > Transform > Scale dialog, you can do it precisely.

But here's a link to the extension. I needs to be installed though. Do you need instructions?

https://github.com/Moini/inkscape-realscale-extension/

Moini
Posts: 3381
Joined: Mon Oct 05, 2015 10:44 am

Re: Resize image based on fixed dimension w/in image

Postby Moini » Wed Dec 02, 2015 12:18 pm

flappypenguin, please look into the log file for the extensions that you can find one folder up from the folder displayed here:
Edit -> Preferences -> System -> Inkscape extensions

Anything about the realscale extension in the log?

Where did you copy the files? Did you adjust permissions as necessary?
Something doesn't work? - Keeping an eye on the status bar can save you a lot of time!

Inkscape FAQ - Learning Resources - Website with tutorials (German and English)

User avatar
brynn
Posts: 10309
Joined: Wed Sep 26, 2007 4:34 pm
Location: western USA
Contact:

Re: Resize image based on fixed dimension w/in image

Postby brynn » Wed Dec 02, 2015 12:57 pm

Just to make sure you're looking in the right place, when it's installed, it's in Extensions menu > Scaling > RealScale

flappypenguin
Posts: 5
Joined: Tue Dec 01, 2015 7:40 pm

Re: Resize image based on fixed dimension w/in image

Postby flappypenguin » Wed Dec 02, 2015 2:10 pm

Moini, I don't see a log file in that location (Inkscape extensions folder is C:\Program Files\Inkscape\share\extensions, so one folder up would be C:\Program Files\Inkscape\share\). I searched all the subdirectories too. View hidden files is turned on.

I copied the files (inx and py) directly to the C:\Users\Name\AppData\Roaming\inkscape\extensions folder.
By adjust permissions, do you mean to copy them into that folder as administrator?

TIA...

Moini
Posts: 3381
Joined: Mon Oct 05, 2015 10:44 am

Re: Resize image based on fixed dimension w/in image

Postby Moini » Wed Dec 02, 2015 11:55 pm

Sorry, flappypenguin - my fault :/
The extensions log file is user specific, and can be found in C:\Users\Name\AppData\Roaming\inkscape\ , in your case.
As you're on Windows, probably permissions aren't an issue (not a Windows user here).

You shouldn't need admin permissions to copy the files there, and also not to use them, AFAICT. Better to do this as 'yourself'.
Something doesn't work? - Keeping an eye on the status bar can save you a lot of time!

Inkscape FAQ - Learning Resources - Website with tutorials (German and English)

flappypenguin
Posts: 5
Joined: Tue Dec 01, 2015 7:40 pm

Re: Resize image based on fixed dimension w/in image

Postby flappypenguin » Thu Dec 03, 2015 10:54 am

Moini, thanks for the clarification. ;) I'll paste the error log below. Lots of errors but no mention of realscale. :(

Extension "Dia Input" failed to load because a dependency was not met.
Dependency:
type: executable
location: extensions
string: dia2svg.sh
description: The dia2svg.sh script should be installed with your Inkscape distribution. If you do not have it, there is likely to be something wrong with your Inkscape installation.

Extension "Dia Input" failed to load because a dependency was not met.
Dependency:
type: executable
location: path
string: dia
description: In order to import Dia files, Dia itself must be installed. You can get Dia at http://live.gnome.org/Dia

Extension "Dia Input" failed to load because a dependency was not met.
Dependency:
type: file
location: extensions
string: dia2svg.sh

Extension "DXF Output" failed to load because a dependency was not met.
Dependency:
type: executable
location: extensions
string: ps2dxf.sh

Extension "DXF Output" failed to load because a dependency was not met.
Dependency:
type: executable
location: path
string: pstoedit
description: pstoedit must be installed to run; see http://www.pstoedit.net/pstoedit

Extension "DXF Output" failed to load because a dependency was not met.
Dependency:
type: file
location: extensions
string: ps2dxf.sh

Extension "LaTeX" failed to load because a dependency was not met.
Dependency:
type: executable
location: path
string: latex

Extension "LaTeX" failed to load because a dependency was not met.
Dependency:
type: executable
location: path
string: dvips

Extension "LaTeX" failed to load because a dependency was not met.
Dependency:
type: executable
location: path
string: pstoedit

Extension "XFIG Input" failed to load because a dependency was not met.
Dependency:
type: executable
location: path
string: fig2dev

Extension "GIMP XCF" failed to load because a dependency was not met.
Dependency:
type: executable
location: path
string: gimp

Extension "Sketch Input" failed to load because a dependency was not met.
Dependency:
type: executable
location: extensions
string: sk2svg.sh

Extension "Sketch Input" failed to load because a dependency was not met.
Dependency:
type: executable
location: path
string: skconvert

Extension "Sketch Input" failed to load because a dependency was not met.
Dependency:
type: file
location: extensions
string: sk2svg.sh

Moini
Posts: 3381
Joined: Mon Oct 05, 2015 10:44 am

Re: Resize image based on fixed dimension w/in image

Postby Moini » Thu Dec 03, 2015 11:38 am

Mhh. That's very weird. So where did you copy the .py and the .inx files?

If Inkscape doesn't find it, and it doesn't complain that it can't start it, and you are using these files https://github.com/Moini/inkscape-reals ... lscale.inx and https://github.com/Moini/inkscape-reals ... alscale.py from the zip file: https://github.com/Moini/inkscape-reals ... master.zip with Inkscape version 0.91, then it *should* work... :/

The only things I can imagine to cause this would be:
a) the files are not where Inkscape looks for them.
b) the files cannot be accessed by the Inkscape process which is run as your user (so for example, if the files belong to another user, and your user doesn't have read / execute permission)
c) the .inx file is broken in some way because it didn't end up undamaged on your computer. If you copy-pasted it, there might have been something lost, better use the one from the zip directly. File names must also be the same, else it won't work.
d) the .inx file that is in the repository is broken - but I'm using the exactly same one, so I think we can rule that out.

So the only thing I can think of would be to check a) to c) again, and then look for the extension in Scaling -> RealScale.

(The error messages you see in your log are all for some kinds of import or export formats that are only available when you've got the program installed that uses those file formats - so nothing to worry about)
Something doesn't work? - Keeping an eye on the status bar can save you a lot of time!

Inkscape FAQ - Learning Resources - Website with tutorials (German and English)

flappypenguin
Posts: 5
Joined: Tue Dec 01, 2015 7:40 pm

Re: Resize image based on fixed dimension w/in image

Postby flappypenguin » Thu Dec 03, 2015 11:55 am

There it is! I have no idea what happened. I think I right-clicked and saved the files from the Github page the first time, but when I copied from the .zip you just linked it solved the problem. Thanks for the help. :)

Moini
Posts: 3381
Joined: Mon Oct 05, 2015 10:44 am

Re: Resize image based on fixed dimension w/in image

Postby Moini » Thu Dec 03, 2015 12:06 pm

Yay :D - hope it will be useful for you!
Something doesn't work? - Keeping an eye on the status bar can save you a lot of time!

Inkscape FAQ - Learning Resources - Website with tutorials (German and English)


Return to “Help with using Inkscape”