Image resizing for printing

Hi,
I have a simple applet that prints a gif image provided by a 3rd party. I'm using javax to do the printing. My problem is that the image is printing huge, since it's high res, and I'd like to slim it down. Is there a way to do this within the print classes, or do I have to manipulate the image before passing it to the applet? Pseudo-code is below.
Thank you for any help.
Jeff
URL url = new URL(codebase + "filename.gif");
PrintService ps = (previously defined print service)
PrintRequestAttributeSet aset = new HashPrintRequestAttributeSet();
aset.add(OrientationRequested.REVERSE_LANDSCAPE);
DocPrintJob job = ps.createPrintJob();                              
Doc doc = new SimpleDoc(url, DocFlavor.URL.GIF, null);
job.print(doc, aset);

You should resize the image and pass this to yous Doc objecty.Check this
Image inImage = getImage(new URL(codebase + "filename.gif"));
          int maxDim = 120;
          double scale = (double) maxDim / (double) inImage.getHeight(null);
          if (inImage.getWidth(null) > inImage.getHeight(null))
               scale = (double) maxDim / (double) inImage.getWidth(null);
          // Determine size of new image.
          //One of them
          // should equal maxDim.
          int scaledW = (int) (scale * inImage.getWidth(null));
          int scaledH = (int) (scale * inImage.getHeight(null));
          System.out.println(">> "
               + inImage.getSource().getClass()
               + " aspect ratio = "
               + scaledW + " , " + scaledH);
          Image img = inImage.getScaledInstance(scaledW , scaledH, Image.SCALE_SMOOTH);The rest is yours.

Similar Messages

  • How to use Text and Image variables for printing

    I have been working on product configurator with AS3 for several months now.
    I am not proficient with AS3.
    Now, it seems that maybe my design is all wrong.
    Is there a proper way to do this?
    I have a main timeline that has movie clips showing images of different options for the product.
    On the first frame, I use buttons to select the choice for option 1 from the Option1_mc.
    Then I store the choice in a variable.
    I use a button to go to the next choice (frame 10.)
    On frame 10, I use buttons to select the choice for option 2 from the Option2_mc.
    This is stored in another variable.
    There are about 10 options that are selected and stored in variables.
    Some are text values and others are instances of images from the Option movie clips.
    I made a Print_mc to use for printjob.
    I can't get the values of the variables to display in the first frame for printing.
    Any helpl would be appreciated.

    you're welcome.
    you won't insert a variable into a textfield.  you'll assign the text property of your textfield to be the value one of your variables points to.
    so, for example, if you have:
    var var1:String="this is a test";
    you can use:
    tf.text=var1;

  • Best way to increase image size for print

    I have a jpeg of an image that I will have to increase roughly 140% for a final print size of 16"x20". I am creating the final design in InDesign, but am editing the image in Photoshop first. My question is what's the best way to increase the size of the jpeg first in Photoshop (I assume) so that when I bring it into InDesign it is maximized in terms of resolution but not so large that the file size prohibitive for sending.
    I've already cropped the image, but haven't adjusted any of the sizes. The dimensions are currently: 3233 pixels x 2586 pixels, and 10.777 in x 8.62 in at 300 pixels per inch.
    Do I bring it into InDesign this way or increase the document size first in Photoshop? I assume the latter.
    If I increase the size in Photoshop, I assume I should resample the image. If I do, that increases the pixel dimensions and file size to over 82.4M. Is there a way to keep the 300 ppi resolution while reducing the file size?

    Photoshop CC now has Preserve Details as well as Bicubic smoother for enlargements.
    140% is not asking much for enlargements. Photoshop may suffice.
    You mention 300 ppi. Is it  really necessary? In the days of offset presses,that was the standard, but what is it for a photo inkjet or the printer you use? You may not need 300.
    Personally when I enlarge, I like Photozoom Pro. I have it on my Mac and PC and find it better than stock enlargement in Photoshop. Of course it's $99-$199 depending if it's on sale.
    Here's a bit more about digital enlargement in this Sydney Morning Herald article
    http://www.smh.com.au/digital-life/cameras/how-to-enlarge-images-without-pixelation-201306 26-2ovts.html
    Of course Photoshop is for preparing photos for print and the web, so you would want to finish your photos there before moving them to InDesign.
    Trevor Dennis, Noel Carboni and many other professionals can give better answers on the subject of enlargement and printing so I hope they will post advice as well.
    I can't answer the last one honestly, I've never prepared prints for room exhibit, so I can't say what works best.
    Good luck. I hope you can get it sorted out.
    Gene

  • Landscape Report - Need to resize for printing it portrait

    I have a financial report that I run often and it was originally designed as a landscape report. I want to reformat this report so that it will work for printing it in portrait. I don't really want to take a bunch of time to redesign this, I just want to resize the whole thing so that it will work to print portrait instead of landscape. I was originally using my printer driver to do this because it had a resize functionality that seemed to work pretty well for this. Now, however, after that printer died, I can't do that anymore with the new printer's driver. Any ideas how this could be EASILY resized for portrait? I have a bunch of fields in this report and it's going to be complicated and time consuming to mess with it much, so I'm wondering if there's some shortcut to do this quickly and easily. I'm using Crystal Reports 9.

    Export to PDF format, it should resize your rpeort for you.

  • Free Image Resizer for Pix?

    just wondering if the apple has any power toys such as windows. i use to always use the image resizer power toys for windows. does the macbook pro have it as well? or is there any applications that is already installed on here that i can use it. i swear i looked through all of the apps,and could not found anything that could help me.

    I don't know what you mean by 'power toys'. But if it is image resizer that you want, try ToyViewer at http://www7a.biglobe.ne.jp/~ogihara/software/index.html
    It's light, and fairly easy to use. Lots of basic functions as well.

  • Automatically Image-Resize On Printed Documentation Output

    Hello,
    I'm again
    I have one new problem.
    If I generate a printed documentation as *.docx file, RoboHelp is resizing my images.
    I insert screenshots in the topics und gave them new width and height values.
    If I generate the output as *.docx, RoboHelp take my image, keep the width, but resets the height to the original one. So I have horrible stretched pictures
    How can I solve this problem?
    Does somebody maybe know it?
    Cheerio,
    Denis

    By "export" I take it you mean create a printed document.
    See if it happens in a new project and if it does, then it looks like a bug.
    The more people who report a bug or request a feature, the more likely it is to be actioned. Please follow this link.
    http://www.Adobe.com/cfusion/mmform/index.cfm?name=wishform&product=38
    See www.grainge.org for RoboHelp and Authoring tips
    @petergrainge

  • Exporting/Resizing for printing

    Help! Please be gentle with me...
    I have 100's of images a friend wants me to give them so they can print them.. I don't know what size, some will be 6 x 4 and some might be 8 x 10's
    Imported and converted to DNG into LR I image has dimension size of 3264 x 4912 or 4912 x 3264. Some have been cropped.
    When exporting them all as a batch, I am confused as to a general settings to use
    I am thinking Jpeg Quality 80? Not checking re size to fit and DPI 300.
    I have been experimenting and the file sizes exported vary hugely from 456k to 4.29mb for 1 image
    Any help is much appriciated
    Thanks

    Thanks for your replies..... Now I am totally confused! I can't look at LR as I'm importing at the mo....
    Ah, the min dimentions to print an 8 x 10 are 2400 x 3000 I believe, so if all of the images are at least that then they would be able to take the memory stick into a printers and get a printed image? what would happen if they chose a 4 x 6 or 5 x 7?
    Thanks, really appriciate your help

  • Image Resolution for Printing Photos

    I am not sure if the resolution/files size requirements are the same for both inkjets (e.g. Epson) and taking your camera's SD card to a local self-serve kiosk (e.g. CVS).
    I have been taking photos at the larger file size with my Canon Powershot and importing them into iPhoto. But I just realize that I am going to have a gigantic iPhoto library a lot sooner then expected.
    But let's say I wanted to print theses images to a typical 4" x 6" dimension gloss paper stock. What is the rule of thumb in terms of minimum/ideal resolution and file size of the image(s) that I want to print? What about 8.5" x 11"?
    Below is the available settings for my camera:
    L = 4000 x 3000 = 12MB file
    M1 = 3264 x 2448 = 8MB file
    M2 = 2592 x 1944 = 5 MB file
    M3 = 1600 x 1200 = 2MB file
    S = 640 x 480 = 0.3 MB file
    Sometime when I open the original JPG in Photoshop the resolution is at 72 lpi. Other times it will be 180 lpi. I guess I am trying to get a sense of what resolution I should set my camera at and what adjustments do I need to make (if any) when it is time to print to paper stock.

    The rule of thumb is 300 dpi. But it's  rule of thumb and you can get excellent images from 180 or less with a: a good printer and b: (most importantly) a good shot, well focused and exposed.
    So to find out the maximum you'll get at 300dpi from your list, just divide the numbers by 300: 4000 x 3000 / 300 = 13.3 x 10 print.
    For my money: set your camera to the best quality and size always. It's easy to through throw away bits og a photo, but you can't add in missing bits after the fact. Maximum everything gives you most margin for error.
    If you're worried about space then remember you can run a Library from an external drive:
    Make sure the drive is formatted Mac OS Extended (Journaled)
    1. Quit iPhoto
    2. Copy the iPhoto Library from your Pictures Folder to the External Disk.
    3. Hold down the option (or alt) key while launching iPhoto. From the resulting menu select 'Choose Library' and navigate to the new location. From that point on this will be the default location of your library.
    4. Test the library and when you're sure all is well, trash the one on your internal HD to free up space.
    Regards
    TD

  • IOS 4.2 no image resize for mailing out of photos...?

    While the iPhone offers several options for image size when I send photos out of photos the iPad does not.. Is that normal even for 4.2 or am I missing a setting somewhere? This is hugely annoying bc I only have camera and iPad with me traveling and not always a good Internet connection to upload 10mb pics...
    Any suggestions how to get the pics emailed out downsized?
    Cheers
    Greg

    As iOS 4.2 has not yet been generally released, you might do better asking this question of your fellow developers in the Developers' Forum.
    Best of luck.

  • Help with cropping & sorting images prior to export for print

    I have large project (wedding) within which I've sorted images into several folders (pre-wedding, church, family portraits, etc.) within which there are smart albums based on my ratings. I also have a generic "5 Star" album at the top level which contains the final images that have been adjusted and which the client has been provided with in order to choose from.
    I now have a list of print requirements from the client (image name, size, and quantity).
    I'm curious to know what the quickest way to sort and tag the images selected for print, particularly in view of there being a number of different size requests for the images which are to be printed.
    Also - I'd value opinions (based on experience) on whether I should bother cropping to size for images that are 5x7 and 8x10 (the default ratio is 2x3 at the moment).
    The bottom line is that I'm trying to minimise the amount of time I spend on print tagging and cropping prior to export, and post export sorting prior to sending off to the lab.
    Thanks,
    Paul

    To answer your questions:
    I am assuming that you want a new version of the crop size especially if you have an image/s that are required in multiple sizes like 8x10 and 5x7 the image would end up in each crop size album so you would have two versions one for each aspect ratio and doing the new version in the context of the album would make in the album pic so that the proper one will be at the top of the stack in each respective album.
    Orientation does not matter with the stamp it will work fine - if you have an issue let me know.
    with respect to the stamp - the stamp will position the crop relative to the one you lifted - if your lifted crop is in the middle then so will the stamped ones.
    As for adjustment of the crop - just click on the crop tool, the click on the browser image and arrow through the images with the crop tool open - you can drag the crop around for each one with a minimum of keystrokes.
    Try it and hit me back with issues. I do this all the time and it is about 3000x quicker than my old workflow 5 years ago. For that matter the power of albums, stacks, and stack picks for this kind of thing is fabulous, there are a million ways to use it to speed things up. Bonus is that you are not copying anything so it is virtually free from a resource perspective.
    Last but not least I would think twice before using a smart album to do this, youi really do not want the content changing in this type of album, it will not save you any time, I would use static albums in the manner that I suggested.
    RB
    Ps. If you are interested in the ins and outs of Aperture organization features check out my PDF on the subject there is a bunch of stuff like this.

  • Exporting for Print

    Hello all...When prepping an image export for print, the following values are asked for by my print company. Not sure about these two:
    1. What resolution do I export at?  How do I know the maximum I have available on that image with enlarging?
    2. LR does not allow me to select a bit depth when I export.  They require 8bit how can we verify this?
    TIA,
    Amelia

    1. If by resolution you mean pixels per inch, there is no maximum. Normally printers require 240 or 300 ppi. If you want a picture a certain size (say 4x6), you need to crop the image to that size and then export, and in the Export dialog you can set the pixels per inch to give you 4x6.
    2. If you export as a .jpg, then it has to be 8-bit. All .jpg photos are 8-bit.

  • Is it possible to optimize this Bilinear Image Resizing Method more?

    I'm trying to write a speedy bilinear image resizer, for displaying images so it doesn't need to me 100% accurate, just look correct.
    So far i've come up with
         public static final Image resampleImage(Image orgImage, int newWidth, int newHeight) {
              int orgWidth = orgImage.getWidth();
              int orgHeight = orgImage.getHeight();
              int orgLength = orgWidth * orgHeight;
              int orgMax = orgLength - 1;
              int[] rawInput = new int[orgLength];
              orgImage.getRGB(rawInput, 0, orgWidth, 0, 0, orgWidth, orgHeight);
              int newLength = newWidth * newHeight;
              int[] rawOutput = new int[newLength];
              int yd = (orgHeight / newHeight - 1) * orgWidth;
              int yr = orgHeight % newHeight;
              int xd = orgWidth / newWidth;
              int xr = orgWidth % newWidth;
              int outOffset = 0;
              int inOffset = 0;
              // Whole pile of non array variables for the loop.
              int pixelA, pixelB, pixelC, pixelD;
              int xo, yo;
              int weightA, weightB, weightC, weightD;
              int redA, redB, redC, redD;
              int greenA, greenB, greenC, greenD;
              int blueA, blueB, blueC, blueD;
              int red, green, blue;
              for (int y = newHeight, ye = 0; y > 0; y--) {
                   for (int x = newWidth, xe = 0; x > 0; x--) {
                        // Set source pixels.
                        pixelA = inOffset;
                        pixelB = pixelA + 1;
                        pixelC = pixelA + orgWidth;
                        pixelD = pixelC + 1;
                        // Get pixel values from array for speed, avoiding overflow.
                        pixelA = rawInput[pixelA];
                        pixelB = pixelB > orgMax ? pixelA : rawInput[pixelB];
                        pixelC = pixelC > orgMax ? pixelA : rawInput[pixelC];
                        pixelD = pixelD > orgMax ? pixelB : rawInput[pixelD];
                        // Calculate pixel weights from error values xe & ye.
                        xo = (xe << 8) / newWidth;
                        yo = (ye << 8) / newHeight;
                        weightD = xo * yo;
                        weightC = (yo << 8) - weightD;
                        weightB = (xo << 8) - weightD;
                        weightA = 0x10000 - weightB - weightC - weightD;
                        // Isolate colour channels.
                        redA = pixelA >> 16;
                        redB = pixelB >> 16;
                        redC = pixelC >> 16;
                        redD = pixelD >> 16;
                        greenA = pixelA & 0x00FF00;
                        greenB = pixelB & 0x00FF00;
                        greenC = pixelC & 0x00FF00;
                        greenD = pixelD & 0x00FF00;
                        blueA = pixelA & 0x0000FF;
                        blueB = pixelB & 0x0000FF;
                        blueC = pixelC & 0x0000FF;
                        blueD = pixelD & 0x0000FF;
                        // Calculate new pixels colour and mask.
                        red = 0x00FF0000 & (redA * weightA + redB * weightB + redC * weightC + redD * weightD);
                        green = 0xFF000000 & (greenA * weightA + greenB * weightB + greenC * weightC + greenD * weightD);
                        blue = 0x00FF0000 & (blueA * weightA + blueB * weightB + blueC * weightC + blueD * weightD);
                        // Store pixel in output buffer and increment offset.
                        rawOutput[outOffset++] = red + (((green | blue) >> 16));
                        // Increment input by x delta.
                        inOffset += xd;
                        // Correct if we have a roll over error.
                        xe += xr;
                        if (xe >= newWidth) {
                             xe -= newWidth;
                             inOffset++;
                   // Increment input by y delta.
                   inOffset += yd;
                   // Correct if we have a roll over error.
                   ye += yr;
                   if (ye >= newHeight) {
                        ye -= newHeight;
                        inOffset += orgWidth;
              return Image.createRGBImage(rawOutput, newWidth, newHeight, false);
         }I was wondering if anyone can see any problems with this, or suggest any faster ways of doing this.
    Thanks
    Edited by: chris.beswick on Nov 5, 2008 3:24 AM
    Edited by: chris.beswick on Nov 5, 2008 3:40 AM - Changed title to reflect what I am after.

    Thanks for the reply.
    Sadly, both the methods in the link are for simple nearest neighbour resizing, which looks god awefull. In addition the first one on the page is insanely slow only only needed with much versions of J2ME that do not support directly accessing pixel data from Image (via getRGB()).
    I started with something like the second example, and have them tweaked it down while adding in the weighted re sampling of the 4 nearest pixels, to remove jaggies. I've managed to get my "bilinear" version to be only around 4 times slower than nearest neighbour, which given that it reads 4 times the data for each pixel is not bad... just wondering if I can go any faster :D
    My current intention is it use a fast nearest neighbour while the image is being moved around / zoomed, and then when there is a pause in user input update the image with the bilinear image.
    Also, I'm trying to use variables (xA, xB, xC, xD) in place of arrays(x[0], x[1]. x[2]. x[3]) as I've read somewhere it is faster as there is no need for bounds checks when accessing a variable unlike an array,
    Finally, does anyone have any good ideas on using bit shifting to approximate all the multiplication (ie x << 8 instead of x * 256) of the pixels by weights, the resulting answer may be "wrong" but if it is close enough it might work.
    Chris
    Edited by: chris.beswick on Nov 5, 2008 4:14 AM

  • Discussion about image resizing

    Hi,
    I'd like to get some point of views regarding image resizing ....
    Handling images is always a lot of work, having to resize, give names, then alt tags then titles  etc ..... Depending on the design, on one page one image has to be 200px wide , on another 150 and in the gallery 600px ..... Hw do you handl this, do you really resize all images so they fit where they need to be , and do thumbs everytime or do you use automatic resizing .... Server side, css ?
    In an ideal world I would like to have just one folder with one version of all images and be able to use those ones without having to resize them manually .... What do you reckon ?
    Obviously, I'm not talking about high resolution images or full screen images but images that would rnge between 400 to 600px wide for instance. Do we still have to think about server load and download speed today in 2012 ? Do you think or know it really affects ranking on search engines .... well ... debate is open , I'm really interested in getting all point of views as they surely be very different from one user to another !!

    In the old days, when connection speeds were modem-sized, it was important to be conservative with regard to page weight.  In this era of high-speed internet, it's not so much.  My pages that use lots of full-size and thumbnail images will often just use the larger image resized for the thumbnail.  Resizing down is fast and cosmetically acceptable. 
    Also, I'm certain that image size has no impact on search engine ranking.

  • Image resize in CS5 vs cell size in LR3 for large print quality

    What is the benefit of image resizing(larger) with resampling in photoshop than creating a larger cell size and increasing the DPI in LR3 if the file is to be printed just out of LR3.  Is there a significant improvement in image quality if this is done in CS5, if so then what about the need for fractal program.  I am taking my images with a D3x and making prints up to 20x30 on Epson 7900?

    Interoperation from LR is far superior to the basic in PS CS 4, whilst this may have improved in CS 5 I haven't tried it and wouldn't expect it to be any better than LR 3. The print module in LR can also make it all a lot easier to do than using PS. Some may still prefer Genuine Fractals (I have a copy), however I have felt no need for it since LR 2. Any resizing I require is done using LR

  • Footer image not resizing in printed documentation

    RH11
    Does anyone know why an image inserted into a footer master page is not automatically resizing to the width of the printed page when applied to a print layout and output to Word? If you insert an image into the body of a topic or a master page and generate printed documentation, the image automatically resizes.
    I'm trying to insert a high-res footer image (300 dpi) into my footer so that it appears on every page, but at the moment it's being embedded at full-size.
    Thanks
    Jonathan

    Firstly, your better off using liststyles than paragraph list styles, I screwed around a long time before I had to set everything to liststyles rather than paragraph ones. So dont worry about that.
    The first issue, of not seeing the style - it is there, if you open the Styles tab on screen (click in a topic to get the cursor, then Format > Styles), not just the dropdown like youve shown youll see a list of all your styles, almost, it will show paragraph styles, click the drop-down and select All available styles, this will display your list styles as well!
    Im not sure about the style settings, I have the same text setting applied in my list style as I use for my 'normal' text. Though I think you can select the text in a list and apply a paragraph style to it....i just tried and it worked, but to be on the safe side you might want to set the text formatting in the list style css too..
    mine looks like this
    li.NumberList {
        font-family: Helvetica, sans-serif;
        font-size: 10pt;
        color: #524C45;
        list-style: decimal;
        margin-bottom: 6pt;
        margin-top: 6pt;
    As for printed formats not indenting lists, this is an issue. So far I have found no way around it because you cannot map a  list styles in RH to a list style in Word. This has also created errors for line spacing and indents - and  I found the indents are severly messed up when using list styles in snippets. Everytime I create printed documentation I have to manually fix it, a pain but it doesnt take too long....you could use macros etc to speed it all up for you.
    Submit a Wish Form.
    Hope it helps.
    Nick

Maybe you are looking for

  • How to create a datasource in CTBW

    Hello Gurus, I am asked to create a new datasource 0vendor_attr in tcode CTBW I am giving the details such as Basis datasource,class,client type,object table ,datasource type ,A datasource is getting created with naming convention 1CL_OVEN001,i am sa

  • Need help understanding profiles and color management

    I made the big leap from inexpensive inkjets to: 1 Epson 3800 Standard 2 Spyder3Studio I have a Mac Pro Quad, Aperture, PS3, etc. I have a steep learning curve ahead, here's what I've done: 1 Read a lot of books, watched tutorials, etc. 2 Calibrated

  • Install cf8 standard edition with remote apache?

    I am interested in installing cf8 standard edition on a stand alone server on a windows (win2003 standard 64 bit) box. An Apache web server (centOS 5) and a mysql will be another two separate servers. So, I am wondering if this infrastructure is OK?

  • How culd b a prog. name under development field for standard SAP prog.??

    Hi Experts, Just curious that, a FI/CO prog. with name GP2I9IU2LWTB3VSHAU4K8ENBKLB100  (its associate tx  is a FI/CO transaction, its S_ALR_87012993 ) noticed that, its developed & changes by here my coleague at client place-SAP customer( I mean to s

  • Use of keyboard

    Hello, My name is Gunner Hodgson and I recently started using a Macbook Pro. To start with, I would like to say that I love it. I also purchased the Apple Pro Keyboard, because as a student I have to type 10 page essays and I don't want to get carpel