Welcome to TalkGraphics.com
Results 1 to 10 of 10
  1. #1
    Join Date
    Oct 2007
    Location
    Richmond, MI USA
    Posts
    1,221

    Default What is the "correct" way to export a .jpg to an exact size?

    I'm having a hard time exporting a drawing to be an exact size as a jpg. Even if I take a blank page, put a box on it at 400px by 200px and export the box, it sometimes changes the final size to 399px or 401px. If I tab through the options I see it change and I have to go back and "fix" it to make the size stick. Am I doing something wrong, or what is the correct workflow procedure if I know the exact size the jpg needs to be when finished?

  2. #2
    Join Date
    Feb 2007
    Location
    UK
    Posts
    21,326

    Default Re: What is the "correct" way to export a .jpg to an exact size?

    I'd say start by making sure that the outline of the box is in whole pix, as well as the size of the box itself being in whole pix

    maybe better not to have an outline at all, though that can be tricky....

    I don't know if there is a definitive answer to this...
    -------------------------------
    Nothing lasts forever...

  3. #3
    Join Date
    Dec 2007
    Location
    North Aurora, Illinois
    Posts
    2,480

    Default Re: What is the "correct" way to export a .jpg to an exact size?

    This has happened to me in XX too but it's also happened in PaintShopProXI. Not sure what causes it.
    Things you should never say when pulled over by the police:
    Could you hold my beer while I dig out my license?

  4. #4

    Default Re: What is the "correct" way to export a .jpg to an exact size?

    Here's what I do that seems to work consistently.

    Make sure that the grid setup is in whole pixel major spacing divisions (of ten with 10 subdivisions). My page units are always set at pixels too.
    Turn on grid snapping and position your 400x200 rectangle, you'll see the X/Y position co-ords are showing whole pixel postions rather than say 233.5pix
    Group your drawing and export (checking the 'Bitmap size' TAB when exporting that it's still showing 400x200 at 96dpi)
    Attached Thumbnails Attached Thumbnails Click image for larger version. 

Name:	400x200.jpg 
Views:	224 
Size:	34.1 KB 
ID:	59314  

  5. #5
    Join Date
    Sep 2005
    Location
    London, England
    Posts
    520

    Default Re: What is the "correct" way to export a .jpg to an exact size?

    I tend to find that losing the outline helps, and try exporting the rectangle (rather than all the objects within it) too, as things like shadows and bevels can often extend beyond the borders of the rectangle, even though they don't appear to. A wireframe view often reveals something that has extended beyond the background.

    Exporting just the rectangle as a JPG and NOT the entire group of objects will include anything visible on the face of the rectangle.

  6. #6
    Join Date
    Aug 2000
    Location
    Placitas, New Mexico, USA
    Posts
    41,512

    Default Re: What is the "correct" way to export a .jpg to an exact size?

    Outlines are problematic. Even if the Infobar reads 400 x 200 (for example) if the image has a 1 pixel border, Xtreme spits the difference and adds 1/2 pixel to each side on export.

    If you absolutely have to have an outline, create a rectangle to the size desired, then convert line to shape. Resize the shape in non-fractional pixel amounts, and place this above the image. Do not have any outline on the image itself, only the converted line.

  7. #7

    Default Re: What is the "correct" way to export a .jpg to an exact size?

    Even if the Infobar reads 400 x 200 (for example) if the image has a 1 pixel border, Xtreme spits the difference and adds 1/2 pixel to each side on export.
    I'm not seeing that happening Gary.

    Although my example above (post#4) didn't use any outline, this new (Easter flavoured) example does.

    Following the steps in post#4, the shape (now with 1pix outline) was sized to 400x200 (and checking that the aspect lock was OFF during the sizing) then exported as a jpg @ 96dpi and checking that the Bitmap size remains 400x200 in the export tab.

    The image does indeed export at exactly 400x200, plus it imports back into Xtreme at 400x200 also.

    Try it an let me know your results?
    Attached Thumbnails Attached Thumbnails Click image for larger version. 

Name:	outlines 400x200.png 
Views:	199 
Size:	22.8 KB 
ID:	59319   Click image for larger version. 

Name:	still 400x200.png 
Views:	206 
Size:	7.1 KB 
ID:	59320  


  8. #8
    Join Date
    Aug 2000
    Location
    Harwich, Essex, England
    Posts
    21,929

    Default Re: What is the "correct" way to export a .jpg to an exact size?

    You need to be aware of the "Scale Line Width" setting. This can have a very profound effect on how Xtreme displays the size of an object. If it's "off" it gives the object shape size regardless of outline size. If it's "on" it includes the line width. However, exporting will always include the line width regardless and this can lead to some confusion.
    Attached Files Attached Files
    Egg

    Minis Forum UM780XTX AMD Ryzen7 7840HS with AMD Radeon 780M Graphics + 32 GB Ram + MSI Optix Mag321 Curv monitor
    + 1Tb SSD + 232 GB SSD + 250 GB SSD portable drive + ISP = BT + Web Hosting = TSO Host

  9. #9

    Default Re: What is the "correct" way to export a .jpg to an exact size?

    Thanks Egg, that's something more to be aware of sure.
    By default ScaleLineWidths is set 'ON' and Xtreme seems to account for this as being the entire bounding area of the shape (line inclusive).
    Setting SLW to 'OFF' and Xtreme will export the object with a .5 pixel addition on each side (due the the outline actually being centered on the object's edge, so it's partly 'inline' as well as 'outline') giving you a 1 pixel difference (when a 1 pixel line is used)

    If you set a 2 pixel line width, then the object is still shown as 400x200, but exports as 402x202.

    Here's a UI view of what Egg was pointing out.
    Attached Thumbnails Attached Thumbnails Click image for larger version. 

Name:	how scale line widths affect export size.png 
Views:	190 
Size:	30.6 KB 
ID:	59342  

  10. #10
    Join Date
    Oct 2007
    Location
    Richmond, MI USA
    Posts
    1,221

    Default Re: What is the "correct" way to export a .jpg to an exact size?

    Thank you everyone for your suggestions. It seems the problem does lie with the automatically added border. Using my original example, if I take a blank page and add a 400px by 200px shape, Xara automatically adds a .67px line width border which is then added to the final output. If I make the shape with line width set to none, it exports fine. Thanks!

 

 

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •