Author Topic: [Solved]the export in pixels changes the dimension?  (Read 997 times)

January 14, 2019, 10:28:35 AM
Read 997 times

royer11

  • Sr. Newbie

  • Offline
  • **

  • 7
Hello everyone, when I use the following tool:
Filters /Pixel Tools / Pixellize
When pixelated, it automatically changes the resolution of the image. For example:
I have a 64x64 resolution graphic, now I use the pixellize extension and when I export the image to the same resolution 64x64, it exports me in the same resolution but with blank spaces and in the middle the image.

Well what I want is for the image to occupy the whole contour when exporting.
example.svg
*example.svg
(12.46 kB . 210x297)
(viewed 209 times)
« Last Edit: January 17, 2019, 04:27:27 PM by royer11, Reason: solved »
  • 0.92.3
  • windows 8.1

January 14, 2019, 02:19:15 PM
Reply #1

Lazur

  • IC Mentor

  • Offline
  • ******
  • Inkscape Filters Wizard

  • 1,154
  • Gender
    Male

    Male
Hi.

The built-in filters increase the visual bonding box of the filtered objects.
You can switch to geometric bounding box in the preferences (Shift+Ctrl+P) at tools (topmost row; very first setting).

Although if you are also using clipping in your image -or better use clipping than changing the bounding box settings- just group the filtered object and clip it to the desired 64 px/ 64 px square size.

January 14, 2019, 06:29:34 PM
Reply #2

royer11

  • Sr. Newbie

  • Offline
  • **

  • 7
Hi.

The built-in filters increase the visual bonding box of the filtered objects.
You can switch to geometric bounding box in the preferences (Shift+Ctrl+P) at tools (topmost row; very first setting).

Although if you are also using clipping in your image -or better use clipping than changing the bounding box settings- just group the filtered object and clip it to the desired 64 px/ 64 px square size.
Excuse me, I'm lost, could you make a screenshot please?
  • 0.92.3
  • windows 8.1

January 14, 2019, 09:27:40 PM
Reply #3

brynn

  • Administrator

  • Offline
  • ******

  • 3,941
  • Gender
    Female

    Female
    • Inkscape Community
Welcome to the forum!

I'll try using some simpler language.  Most filters make the image larger (although most of the time you can't see the part that's larger).  The dashed line rectangle that you see around an object when you select it, is called the bounding box.  There are 2 different kinds of bounding boxes.  The one you're using (which is the default) is called the visual bounding box.

In Edit menu > Inkscape Preferences > Tools, you can switch to using the geometric bounding box.  That won't show the extra size after you add the filter, so the image stays the same size.

If later, you find that there's some reason you don't want to use the geometric bounding box, then there's another technique called Clipping, which will make the image the original size.  Most of the time, the geometric bounding box should be fine though.  Ever since I changed to the geometric bounding box maybe 8 years ago, I've never switched back.
  • Inkscape version 0.92.3
  • Windows 7 Pro, 64-bit
Inkscape Tutorials (and manuals)                      Inkscape Community Gallery                        Inkscape for Cutting Design                     



"Be ashamed to die until you have won some victory for humanity" - Horace Mann                       

January 14, 2019, 10:26:11 PM
Reply #4

royer11

  • Sr. Newbie

  • Offline
  • **

  • 7
Welcome to the forum!

I'll try using some simpler language.  Most filters make the image larger (although most of the time you can't see the part that's larger).  The dashed line rectangle that you see around an object when you select it, is called the bounding box.  There are 2 different kinds of bounding boxes.  The one you're using (which is the default) is called the visual bounding box.

In Edit menu > Inkscape Preferences > Tools, you can switch to using the geometric bounding box.  That won't show the extra size after you add the filter, so the image stays the same size.

If later, you find that there's some reason you don't want to use the geometric bounding box, then there's another technique called Clipping, which will make the image the original size.  Most of the time, the geometric bounding box should be fine though.  Ever since I changed to the geometric bounding box maybe 8 years ago, I've never switched back.
Ohhh, fantastic thank you very much for your help
  • 0.92.3
  • windows 8.1

January 14, 2019, 11:44:36 PM
Reply #5

brynn

  • Administrator

  • Offline
  • ******

  • 3,941
  • Gender
    Female

    Female
    • Inkscape Community
  • Inkscape version 0.92.3
  • Windows 7 Pro, 64-bit
Inkscape Tutorials (and manuals)                      Inkscape Community Gallery                        Inkscape for Cutting Design                     



"Be ashamed to die until you have won some victory for humanity" - Horace Mann                       

January 15, 2019, 09:09:47 AM
Reply #6

royer11

  • Sr. Newbie

  • Offline
  • **

  • 7
Sorry, I have solved this

When exporting the image comes out as follows

What can be done in this difficulty?
  • 0.92.3
  • windows 8.1

January 15, 2019, 10:14:15 AM
Reply #7

brynn

  • Administrator

  • Offline
  • ******

  • 3,941
  • Gender
    Female

    Female
    • Inkscape Community
Did you use File menu > Export PNG ?  If that's the case, then you probably just had the wrong option selected.  At the top of that dialog are 4 buttons:  Page, Drawing, Selection, and Custom.  That's how you choose which part of the canvas you want to export. 

It's hard to say for sure which option you might have used.  I'm not sure where that black square outline came from.  If you could share the SVG file, I could say for sure.  But now that you know about those 4 options, you can probably make a better choice this time.  So I probably don't need to see the SVG file.

I would suggest using Selection.  Then make sure the image (or the green square) is selected when you click Export button.
  • Inkscape version 0.92.3
  • Windows 7 Pro, 64-bit
Inkscape Tutorials (and manuals)                      Inkscape Community Gallery                        Inkscape for Cutting Design                     



"Be ashamed to die until you have won some victory for humanity" - Horace Mann                       

January 15, 2019, 11:20:04 AM
Reply #8

royer11

  • Sr. Newbie

  • Offline
  • **

  • 7
Excuse me for not giving details, I'll start with this configuration

now I make the selection of the drawing

once selected, I have used this tool and you can appreciate the configuration


and here is my result, good export comes with a transparent outline and in its center is the graph.
What I want is for the drawing to occupy the whole image.


  • 0.92.3
  • windows 8.1

January 15, 2019, 12:10:02 PM
Reply #9

Lazur

  • IC Mentor

  • Offline
  • ******
  • Inkscape Filters Wizard

  • 1,154
  • Gender
    Male

    Male
You can always use grouping and clipping.
Or what is eventually the same, define an export area by another object.
Or by setting up the page to be 64 px by 64 px and export the page to png. Works like a charm.

January 15, 2019, 01:38:20 PM
Reply #10

brynn

  • Administrator

  • Offline
  • ******

  • 3,941
  • Gender
    Female

    Female
    • Inkscape Community
One thing I see in your screenshot.  In the Export PNG dialog, the DPI should be 96.0.  I don't think that will fix the problem though.

After some testing, it looks like no matter what kind of bounding box you  use, the Export PNG feature still thinks the image is larger than the bounding box (because of the filter).  I think you will need to use one of Lazur's suggestions.

After testing with clipping, I'm not sure if it's going to work.  But here's a way that I know will work.  (Note that this is one of Lazur's suggestions.)

1 -- File menu > Document Properties > Page tab > Custom Size
2 -- Set the page size for the size you want the image (64 px)
3 -- Center your image on the page
      a - Object menu > Align and Distribute
      b - for Relative to: dropdown menu, choose Page
      c - click both of these buttons   :ava: and :aha:
4 -- File menu > Export PNG, and use the Page option (will export only what's inside the page border) (be sure to set the DPI for 96.0)

I didn't look at the SVG file which Lazur attached for you, but it might be showing you how to do this too.  I'm sure it's showing you at least one way to make this work.  Be sure to have a look at it.

  • Inkscape version 0.92.3
  • Windows 7 Pro, 64-bit
Inkscape Tutorials (and manuals)                      Inkscape Community Gallery                        Inkscape for Cutting Design                     



"Be ashamed to die until you have won some victory for humanity" - Horace Mann                       

January 15, 2019, 02:50:27 PM
Reply #11

royer11

  • Sr. Newbie

  • Offline
  • **

  • 7
One thing I see in your screenshot.  In the Export PNG dialog, the DPI should be 96.0.  I don't think that will fix the problem though.

After some testing, it looks like no matter what kind of bounding box you  use, the Export PNG feature still thinks the image is larger than the bounding box (because of the filter).  I think you will need to use one of Lazur's suggestions.

After testing with clipping, I'm not sure if it's going to work.  But here's a way that I know will work.  (Note that this is one of Lazur's suggestions.)

1 -- File menu > Document Properties > Page tab > Custom Size
2 -- Set the page size for the size you want the image (64 px)
3 -- Center your image on the page
      a - Object menu > Align and Distribute
      b - for Relative to: dropdown menu, choose Page
      c - click both of these buttons   :ava: and :aha:
4 -- File menu > Export PNG, and use the Page option (will export only what's inside the page border) (be sure to set the DPI for 96.0)

I didn't look at the SVG file which Lazur attached for you, but it might be showing you how to do this too.  I'm sure it's showing you at least one way to make this work.  Be sure to have a look at it.
One thing I see in your screenshot.  In the Export PNG dialog, the DPI should be 96.0.  I don't think that will fix the problem though.

After some testing, it looks like no matter what kind of bounding box you  use, the Export PNG feature still thinks the image is larger than the bounding box (because of the filter).  I think you will need to use one of Lazur's suggestions.

After testing with clipping, I'm not sure if it's going to work.  But here's a way that I know will work.  (Note that this is one of Lazur's suggestions.)

1 -- File menu > Document Properties > Page tab > Custom Size
2 -- Set the page size for the size you want the image (64 px)
3 -- Center your image on the page
      a - Object menu > Align and Distribute
      b - for Relative to: dropdown menu, choose Page
      c - click both of these buttons   :ava: and :aha:
4 -- File menu > Export PNG, and use the Page option (will export only what's inside the page border) (be sure to set the DPI for 96.0)

I didn't look at the SVG file which Lazur attached for you, but it might be showing you how to do this too.  I'm sure it's showing you at least one way to make this work.  Be sure to have a look at it.


Thank you very much for your answers and indeed if it works only it will be very difficult if in a document I want to draw all the objects
  • 0.92.3
  • windows 8.1

January 17, 2019, 03:07:38 PM
Reply #12

brynn

  • Administrator

  • Offline
  • ******

  • 3,941
  • Gender
    Female

    Female
    • Inkscape Community
Oh, so you mean you have other drawings in the same file?  Here's another way to do it, and you won't have to change the page size for every drawing.

1 -- Draw a rectangle of the size that you want for the image.  (Make sure the rectangle doesn't have any fill color, and you can either make the stroke very thin (such as 0.01 px width) or make it almost completely transparent (1% opacity).)
2 -- Center the drawing inside the rectangle (using Align and Distribute dialog with the same buttons I mentioned above).
3 -- Select only the new rectangle (and not the image)
4 -- Use the Selection option in Export PNG dialog
  • Inkscape version 0.92.3
  • Windows 7 Pro, 64-bit
Inkscape Tutorials (and manuals)                      Inkscape Community Gallery                        Inkscape for Cutting Design                     



"Be ashamed to die until you have won some victory for humanity" - Horace Mann                       

January 17, 2019, 04:26:50 PM
Reply #13

royer11

  • Sr. Newbie

  • Offline
  • **

  • 7
Oh, so you mean you have other drawings in the same file?  Here's another way to do it, and you won't have to change the page size for every drawing.

1 -- Draw a rectangle of the size that you want for the image.  (Make sure the rectangle doesn't have any fill color, and you can either make the stroke very thin (such as 0.01 px width) or make it almost completely transparent (1% opacity).)
2 -- Center the drawing inside the rectangle (using Align and Distribute dialog with the same buttons I mentioned above).
3 -- Select only the new rectangle (and not the image)
4 -- Use the Selection option in Export PNG dialog
Tank you, if it works and it was just what I expected
  • 0.92.3
  • windows 8.1