Resize created image?

I've created an image from scratch using Photoshop CS2 (I combined a number of images into one image), to discover I need to make the image larger. Do I need to start over, or is there a way to resize the image without degrading the quality of the image?
Thanks

The images I started with were large, but I imported them into a project that had a 3" x 3" size. I just discovered I need the final image to be larger, 6" x 6". Is this possible without degrading the quality of the work?
I need it for print. I'm designing an image a friend is turning into a badge. I found out a min ago the larger the image the better the result.
Thx

Similar Messages

  • Using Javascript & Actions to resize an image and add the filename as text

    Hello,
    I am currently working on a way to take an image, resize it and add exactly what is in it's file name (before extension) as a text layer. I have succeded in this BUT am having issues with file names that require more than one line of text.
    I need the text to align to the bottom of the image & the script or action must then resize the image so that the text does not overlap.
    Any ideas on how this can be done?
    At the moment I am using:
    -"Fit Image.jsx" to resize my image to a specific size (This was included in the Photoshop CS5 scripts)
    - A script to add the file name without extension and place the file name at a specific position.
    AdFileName.jsx
    if ( documents.length > 0 )
    var originalRulerUnits = preferences.rulerUnits;
    preferences.rulerUnits = Units.PIXELS;
    try
      var docRef = activeDocument;
      // Now create a text layer at the front
      var myLayerRef = docRef.artLayers.add();
      myLayerRef.kind = LayerKind.TEXT;
      myLayerRef.name = "Filename";
      var myTextRef = myLayerRef.textItem;
      // strip the extension off
      var fileNameNoExtension = docRef.name;
      fileNameNoExtension = fileNameNoExtension.split( "." );
      if ( fileNameNoExtension.length > 1 ) {
       fileNameNoExtension.length--;
      fileNameNoExtension = fileNameNoExtension.join(".");
      myTextRef.contents = fileNameNoExtension;
      // off set the text to be in the middle
      myTextRef.position = new Array( docRef.width / 2, docRef.height / 2 );
      myTextRef.size = 12;
            myTextRef.font="Arial-BoldMT"
            //set position of text
            myTextRef.justification = Justification.CENTER;
            myTextRef.kind = TextType.PARAGRAPHTEXT;
            myTextRef.width= docRef.width;
            myTextRef.height= docRef.height/ 2;
            myTextRef.position= [0, docRef.height * 0.88];
    catch( e )
      // An error occurred. Restore ruler units, then propagate the error back
      // to the user
      preferences.rulerUnits = originalRulerUnits;
      throw e;
    // Everything went Ok. Restore ruler units
    preferences.rulerUnits = originalRulerUnits;
    else
    alert( "You must have a document open to add the filename!" );
    Can the position be changed to allow more rows of text but keep it aligned with the bottom of the layer?
    How can I script in a way to make the image resize based on the amount of text lines?
    Any help would be greatly appreciated.

    You can add a text layer any where the only thing you need to worry about is the size of the font you use.  You can normally calculate a font size by saving the images resoltuion and then setting its resolution to 72 DPI calculate a font size basied of the images pixel width and the number of characters you want in a line. After adding the text layer you can restore the image to its original resolution and align the text layer by making a selection and alignint the text layer to the selection.  There are nine posibilites like the positions in the selection you can align to like a tick tack toe board. You need to use a script to add the text layer because your retrieving the filename.  The positioning of the text layer could be done easily in an action the would use the scriot to add a text layer the do a select all  the align the added text layer to the selection.
    About your script don't make text paragraph just add new line characters to make a multi line text layer So it can be positioned easily
    I do just that with my stampexif action.  The action uses my stampexif Photoshop java script to add a multi line text layer containing some formatted EXIF data then the action centers the text layer and add a layer style to it. Link http://www.mouseprints.net/old/dpr/StampExif.jsx Example

  • Photoshop CC: Have a template that I moved image into.  Image is too small.  How do I resize the image while in the template?  Or must I go to original image file and resize there again and again until I get the right fit?

    I have a template that I am able to plug different pictures into at different times.  The problem is that when I plug an image into that template, I find that the image is either too big or too small.  Is there a way to plug the image into the template and resize the image (and not the template itself) OR will I have to go to the file with the original image and resize it there and then try to plug it in to the template to see if it fits------and if it does not fit, go back to the original file with the image and resize it again and see if that fits---and so on and so on...........?  I have tried the" image size" option but it's hit or miss------mostly miss!
    Thanks!

    Read up on Smart Objects. It looks like you have no idea as to how to create and use them.
    Jut create a Smart Object from the layer containing whatever it image it is that you are "plugging into your template".  But you do need to learn the application at its most basic levels.
    Photoshop is a professional level application that makes no apologies for its very long and steep learning curve.  You cannot learn Photoshop in a forum, one question at a time.
    Or is it possible that you don't even have Photoshop proper but the stripped-down Photoshop Elements?"
    If the latter is the case, you're in the wrong forum.  This is not the Elements forum.
    Here's the link to the forum you would want if you're working in Elements.:
    https://forums.adobe.com/community/photoshop_elements/content
    If you do have Photoshop proper, please provide the exact version number of that application and of your OS.
    (edited for clarification)

  • Disk Utility: Create Image from Volume Without Unused Space

    I'm trying to create a disk image from a mounted volume (flash memory in a video camera) but I don't want to write to it later, it's just for archiving. The problem is that the size of the original volume is 16 GB, so every image I create is huge, even if there is less than a 1 GB used.
    For example, I only have two short clips on there, about 1.1 GB used. When I create a new .dmg from the volume, the file is 5.28 GB and when I mount it it tells me the size of the volume is 15.3 GB. Clearly I understand why this is happening, it's creating a bit for bit copy of the original volume, but I don't need all that space since I'm never going to write to it.
    In disk utility it won't let me resize the image (it's grayed out). What do I do?

    I actually don't understand why this is happening (when I do this the created disk image only uses the space it needs) but you can get around it as follows. First create a blank read/write disk image to the size you want and then restore the memory card to that image.

  • How do I resize an image in Photoshop CS2?

    Hi! I'm trying to resize an image in Photoshop Cs2 with OUT making it grainy or blurred. Please help!? I know there's some key you can hold down while dragging with the mouse but eh I forgot it! o_0 please help!

    Jody...
    If you have a vector version of the logo, the smartest thing is to resize it as vectors to the size you want, and
    then
    rasterize it.
    Case in point:
    I was trying to make a 16px × 16px favicon for my blogspot site, and the only way I could get the details to appear nice and clean was to create the entire thing from shape layers, transform them all in one go to fit inside a 16px × 16px box I defined using guidelines, and THEN rasterize it using the Save For Web dialogue.

  • How do you resize a image/picture and save it?

    Hello, I know how to resize a image. But how do I save a new image/pictures has Jpeg with new size properties?

    Use File>Save As or File>Save for web. Either of these will create a new document as long as the name is different or is in another folder.

  • Resize html image in email signature

    Hi, I have been trying to insert my company logo in my email signature on Outlook Client 2013 but the results have been disappointing. Would greatly appreciate your assistance. Thank you in advance!
    My company logo is in png-format. Its dimensions are 1221 x 374 px, and has a dpi of192. Its size is 37.9 KB. 
    I have read from various online sources that it is better to resize the image such that it is not larger than 10 KB.
    However, I do not want to resize the image (to ideal width: 150 px) before inserting it in the signature editor, because doing that is bound to degrade the resolution of the image, no matter how good the photo editor is. I have tried gimp and various
    photo editors, but the resulting picture quality is poor and grainy. I can barely make out the text in the logo. 
    These are the 4 methods that I have tried:
    1. I followed this YouTube tutorial. I insert the image in signature editor. The location of the image is at my Desktop. Save and close. 
    I insert the signature in a new email. The resulting image is large and appears according to its original dimensions in my signature. So I resize the image in the inserted email signature, copy that resized image, then paste it in the signature
    editor. The resized image will appear, with reduced dimensions. I save and close the signature editor.
    Then, I insert the signature again in the email. The dimensions of the image are correct and they appear perfect. So I do a test by sending an email to myself. When I view the email on Outlook Client, the image looks perfect. However, on Outlook
    Web App, the image is extremely large and out of place. I have been racking my brains on how to solve this problem.
    2. Same as step 1. But instead of inserting the logo from my Desktop, I inserted the logo located on the web by typing its URL in full. I used: Insert > Link to File.
    However, the same problem appears. The image in the send email looks great on Outlook Client, but too large on Outlook Web App.
    3. Re-render the image to 96 dpi using IrfanView. I read from this source that Outlook will rescale any image that is not 96 dpi.
    Tried Step 1 again. But image size in Outlook Web App is too large again.
    4. I followed the steps in this link to create a HTML email signature. I used an online WYSIWYG HTML editor
    to generate the HTML code. I realised that altering the height and width of the image in the html changes the size of the image only in the WYSIWYG editor. I believe that Outlook Client overrides all provided image dimensions.
    Thank you so much for your help!

    Hi Joy,
    Try this.
    Compose the signature in Outlook, insert the original image, resize it to the correct size, by dragging the image using mouse.
    Compress using inbuilt Outlook tool, this should not degrade the quality of the image much.
    Click the picture or pictures that you want to change the resolution for.
    Under Picture Tools, on the Format tab, in the
    Adjust group, click Compress Pictures.
    If you do not see the Picture Tools and Format tabs, make sure that you selected a picture. You may have to double-click the picture to select it and open the
    Format tab.
    To change the resolution for the selected pictures only and not all of the pictures in the document, select the
    Apply only to this picture check box.
    Under Target output, click the resolution that you want.
    Now, copy all and create a new Signature out of this.
    Send out an email with this new signature and see if it works on OWA.
    Ensure you are checking it on the same PC and the Web browser is on 100% zoom level.
    In my case its appearing slightly smaller on Browser then on PC. Check if its same on different PCs as well.
    Regards,
    Satyajit
    Please “Vote As Helpful”
    if you find my contribution useful or “Mark As Answer” if it does answer your question. That will encourage me - and others - to take time out to help you.

  • Create images with dynamic width from 3 images each (left/center/right-part)

    Hello,
    i want to employ a script to create images of dynamic width for me. The whole process shall base on different sized sets of images, which contain a left-image, a right-image and a center-image. The desired width for the different cases shall be reached by duplicating the center-image between the two outer images and placing those images next to each other until the image extends to desired width.
    The layers importet into Photoshop shall be importet as smart-layers (which i already solved).
    Has anyone done something similar already and could give me some useful hints on that issue ?
    I have come up to this until now:
    #target Photoshop
    // =========================== Opens a new document and asks for dimensions ============================
    var myLayerset = File.openDialog ("Select the set of images you want to use!", "*.png",true)
    var myName = prompt("How do you want to call the document?"); // askes for document name
    var width =  prompt("Please insert width for the output here!", ""); // askes for desired width
    var height = prompt("Please insert height for the output here!", ""); //askes for desired height
    var docName = myName +".psd"
    var idMk = charIDToTypeID( "Mk  " );
        var desc3 = new ActionDescriptor();
        var idNw = charIDToTypeID( "Nw  " );
            var desc4 = new ActionDescriptor();
            var idNm = charIDToTypeID( "Nm  " );
            desc4.putString( idNm, """Wunschname""" );
            var idMd = charIDToTypeID( "Md  " );
            var idRGBM = charIDToTypeID( "RGBM" );
            desc4.putClass( idMd, idRGBM );
            var idWdth = charIDToTypeID( "Wdth" );
            var idRlt = charIDToTypeID( "#Rlt" );
            desc4.putUnitDouble( idWdth, idRlt, width );
            var idHght = charIDToTypeID( "Hght" );
            var idRlt = charIDToTypeID( "#Rlt" );
            desc4.putUnitDouble( idHght, idRlt, height );
            var idRslt = charIDToTypeID( "Rslt" );
            var idRsl = charIDToTypeID( "#Rsl" );
            desc4.putUnitDouble( idRslt, idRsl, 72.000000 );
            var idpixelScaleFactor = stringIDToTypeID( "pixelScaleFactor" );
            desc4.putDouble( idpixelScaleFactor, 1.000000 );
            var idFl = charIDToTypeID( "Fl  " );
            var idFl = charIDToTypeID( "Fl  " );
            var idTrns = charIDToTypeID( "Trns" );
            desc4.putEnumerated( idFl, idFl, idTrns );
            var idDpth = charIDToTypeID( "Dpth" );
            desc4.putInteger( idDpth, 8 );
            var idprofile = stringIDToTypeID( "profile" );
            desc4.putString( idprofile, """sRGB IEC61966-2.1""" );
        var idDcmn = charIDToTypeID( "Dcmn" );
        desc3.putObject( idNw, idDcmn, desc4 );
    executeAction( idMk, desc3, DialogModes.NO );
    //==============================================save document================================================
    var idsave = charIDToTypeID( "save" );
        var desc4 = new ActionDescriptor();
        var idAs = charIDToTypeID( "As  " );
            var desc5 = new ActionDescriptor();
            var idmaximizeCompatibility = stringIDToTypeID( "maximizeCompatibility" );
            desc5.putBoolean( idmaximizeCompatibility, true );
        var idPhtthree = charIDToTypeID( "Pht3" );
        desc4.putObject( idAs, idPhtthree, desc5 );
        var idIn = charIDToTypeID( "In  " );
        desc4.putPath( idIn, new File( "C:\\Users\\ target folder goes here" + docName ) );
        var idDocI = charIDToTypeID( "DocI" );
        desc4.putInteger( idDocI, 308 );
        var idsaveStage = stringIDToTypeID( "saveStage" );
        var idsaveStageType = stringIDToTypeID( "saveStageType" );
        var idsaveSucceeded = stringIDToTypeID( "saveSucceeded" );
        desc4.putEnumerated( idsaveStage, idsaveStageType, idsaveSucceeded );
    executeAction( idsave, desc4, DialogModes.NO );
    //========================================================================================================
    for (var i = 0; i < myLayerset.length; i++) {
    if (myLayerset[i] instanceof File && myLayerset[i].hidden == false) {
    // ======================================================= opens selected images as smart objects====================
    var idOpn = charIDToTypeID( "Opn " );
        var desc1 = new ActionDescriptor();
        var idnull = charIDToTypeID( "null" );
       desc1.putPath( idnull, myLayerset[i]);
        var idsmartObject = stringIDToTypeID( "smartObject" );
        desc1.putBoolean( idsmartObject, true );
    executeAction( idOpn, desc1, DialogModes.NO );
    //===================================duplicates opened layer into created document========================================
    var idDplc = charIDToTypeID( "Dplc" );
        var desc144 = new ActionDescriptor();
        var idnull = charIDToTypeID( "null" );
            var ref135 = new ActionReference();
            var idLyr = charIDToTypeID( "Lyr " );
            var idOrdn = charIDToTypeID( "Ordn" );
            var idTrgt = charIDToTypeID( "Trgt" );
            ref135.putEnumerated( idLyr, idOrdn, idTrgt );
        desc144.putReference( idnull, ref135 );
        var idT = charIDToTypeID( "T   " );
            var ref136 = new ActionReference();
            var idDcmn = charIDToTypeID( "Dcmn" );
            ref136.putName( idDcmn, docName); 
        desc144.putReference( idT, ref136 );
        var idVrsn = charIDToTypeID( "Vrsn" );
        desc144.putInteger( idVrsn, 5 );
    executeAction( idDplc, desc144, DialogModes.NO );
    // ======================================================= close tab without saving ==========
    var idCls = charIDToTypeID( "Cls " );
        var desc156 = new ActionDescriptor();
        var idSvng = charIDToTypeID( "Svng" );
        var idYsN = charIDToTypeID( "YsN " );
        var idN = charIDToTypeID( "N   " );
        desc156.putEnumerated( idSvng, idYsN, idN );
    executeAction( idCls, desc156, DialogModes.NO );

    I adapted a Script somewhat, so you may give this a test.
    But it uses the open file so you would have to adapt it further.
    // arranges the selected jpg, tif, psd in line;
    // gutters may be irregular due to rounding effects;
    // thanks to michael l hale and muppet mark;
    // for mac and CS6;
    // 2014, use it at your own risk;
    #target photoshop
    if (app.documents.length == 0) {
              var myDocument = app.documents.add(UnitValue (300, "mm"), UnitValue (50, "mm"), 300, "new", NewDocumentMode.RGB, DocumentFill.TRANSPARENT)
    else {myDocument = app.activeDocument};
    // set to pixels;
    var originalRulerUnits = app.preferences.rulerUnits;
    app.preferences.rulerUnits = Units.PIXELS;
    var theArray = [0, 0, myDocument.width, myDocument.height];
    // select files;
    if ($.os.search(/windows/i) != -1) {var theFiles = File.openDialog ("please select files", '*.jpg;*.tif;*.pdf;*.psd', true)}
    else {var theFiles = File.openDialog ("please select exactly three files", getFiles, true)};
    // do the arrangement
    if (theFiles) {placeInLines (myDocument, theFiles, theArray)}
    app.preferences.rulerUnits = originalRulerUnits;
    ////// function to place images in lines //////
    function placeInLines (myDocument, theFiles, theArray) {
    theFiles.sort();
    // fit on screen;
    var idslct = charIDToTypeID( "slct" );
    var desc64 = new ActionDescriptor();
    var idnull = charIDToTypeID( "null" );
    var ref44 = new ActionReference();
    var idMn = charIDToTypeID( "Mn  " );
    var idMnIt = charIDToTypeID( "MnIt" );
    var idFtOn = charIDToTypeID( "FtOn" );
    ref44.putEnumerated( idMn, idMnIt, idFtOn );
    desc64.putReference( idnull, ref44 );
    executeAction( idslct, desc64, DialogModes.NO );
    // change pref;
    var originalRulerUnits = app.preferences.rulerUnits;
    app.preferences.rulerUnits = Units.PIXELS;
    setToAccelerated();
    app.togglePalettes();
    var check = turnOffRescale ();
    // create the arrangement;
    if (theFiles.length > 0 && theFiles.length == 3) {
    myDocument.activeLayer = myDocument.layers[0];
    // create masked group;
    var theGroup = myDocument.layerSets.add();
    theGroup.name = "arrangement";
    // determine the array’s values;
    var areaWidth = theArray[2] - theArray[0];
    var areaHeight = theArray[3] - theArray[1];
    var theDocResolution = myDocument.resolution;
    var areaRelation = areaHeight / areaWidth;
    // center of placed non-pdf images;
    var centerX = Number(myDocument.width / 2);
    var centerY = Number(myDocument.height / 2);
    // suppress dialogs;
    var theDialogSettings = app.displayDialogs;
    app.displayDialogs = DialogModes.NO;
    var pdfSinglePages = new Array;
    var nonPDFs = new Array;
    var theDimPDFs = new Array;
    var theLength = 0;
    // collect the files’ measurements;
    var theDimensions = new Array;
    var theLengths = new Array;
    // array to collect both files and placed pdf-pages;
    var theseFiles = new Array;
    var theLength = 0;
    // collect the files’ measurements;
    for (var o = 0; o < theFiles.length; o++) {
        var thisFile = theFiles[o];
              theseFiles.push(thisFile);
              var theDim = getDimensions(thisFile);
              theDimensions.push(theDim);
              theRelativeWidth = 100 / theDim[1] * theDim[0];
              theLength = theLength + theRelativeWidth;
    // reset dialogmodes;
    app.displayDialogs = DialogModes.ERROR;
    // if three files;
    if (theseFiles.length == 3) {
    // create the layers;
    var theNumber = 0;
    var theAdded = 0;
    var y = areaHeight / 2;
    // add placed image’s width;
    var thisLineWidth = 0 + theAdded;
    var theLastFactor = Number (Number(myDocument.height) / theDimensions[2][1] * theDimensions[2][2] / theDocResolution * 100);
    var theLastWidth = Math.round(theDimensions[2][0] * theLastFactor / 100 * theDocResolution / theDimensions[2][2]);
    // place the files;
    for (var x = 0; x < 3; x++) {
    var theNumber = x;
    var thisFile = theseFiles[theNumber];
    var theFactor = Number (Number(myDocument.height) / theDimensions[theNumber][1] * theDimensions[theNumber][2] / theDocResolution * 100);
    var theNewWidth = Math.round(theDimensions[theNumber][0] * theFactor / 100 * theDocResolution / theDimensions[theNumber][2]);
    var offsetX = theNewWidth / 2 + thisLineWidth - centerX + theArray[0];
    var offsetY = y - centerY + theArray[1];
    var theLayer = placeScaleFile (thisFile, offsetX, offsetY, theFactor, theFactor);
    myDocument.activeLayer.move(theGroup, ElementPlacement.PLACEATBEGINNING);
    thisLineWidth = thisLineWidth + theNewWidth;
    // duplicate the middle one;
    if (theNumber == 1) {
              while (thisLineWidth < myDocument.width - theLastWidth) {
                        theLayer = duplicateAndOffset (theLayer, theNewWidth, 0);
                        thisLineWidth = thisLineWidth + theNewWidth;
    // reset;
    app.togglePalettes();
    turnOnRescale (check);
    app.preferences.rulerUnits = originalRulerUnits;
    ////// playback to accelerated //////
    function setToAccelerated () {
              var idsetd = charIDToTypeID( "setd" );
              var desc1 = new ActionDescriptor();
              var idnull = charIDToTypeID( "null" );
                        var ref1 = new ActionReference();
                        var idPrpr = charIDToTypeID( "Prpr" );
                        var idPbkO = charIDToTypeID( "PbkO" );
                        ref1.putProperty( idPrpr, idPbkO );
                        var idcapp = charIDToTypeID( "capp" );
                        var idOrdn = charIDToTypeID( "Ordn" );
                        var idTrgt = charIDToTypeID( "Trgt" );
                        ref1.putEnumerated( idcapp, idOrdn, idTrgt );
              desc1.putReference( idnull, ref1 );
              var idT = charIDToTypeID( "T   " );
                        var desc2 = new ActionDescriptor();
                        var idperformance = stringIDToTypeID( "performance" );
                        var idperformance = stringIDToTypeID( "performance" );
                        var idaccelerated = stringIDToTypeID( "accelerated" );
                        desc2.putEnumerated( idperformance, idperformance, idaccelerated );
              var idPbkO = charIDToTypeID( "PbkO" );
              desc1.putObject( idT, idPbkO, desc2 );
              executeAction( idsetd, desc1, DialogModes.NO );
    ////// get psds, tifs and jpgs from files //////
    function getFiles (theFile) {
        if (theFile.name.match(/\.(jpg|tif|psd|pdf|)$/i)) {
            return true
    ////// place //////
    function placeScaleFile (file, xOffset, yOffset, theScale) {
    // =======================================================
    var idPlc = charIDToTypeID( "Plc " );
        var desc5 = new ActionDescriptor();
        var idnull = charIDToTypeID( "null" );
        desc5.putPath( idnull, new File( file ) );
        var idFTcs = charIDToTypeID( "FTcs" );
        var idQCSt = charIDToTypeID( "QCSt" );
        var idQcsa = charIDToTypeID( "Qcsa" );
        desc5.putEnumerated( idFTcs, idQCSt, idQcsa );
        var idOfst = charIDToTypeID( "Ofst" );
            var desc6 = new ActionDescriptor();
            var idHrzn = charIDToTypeID( "Hrzn" );
            var idPxl = charIDToTypeID( "#Pxl" );
            desc6.putUnitDouble( idHrzn, idPxl, xOffset );
            var idVrtc = charIDToTypeID( "Vrtc" );
            var idPxl = charIDToTypeID( "#Pxl" );
            desc6.putUnitDouble( idVrtc, idPxl, yOffset );
        var idOfst = charIDToTypeID( "Ofst" );
        desc5.putObject( idOfst, idOfst, desc6 );
        var idWdth = charIDToTypeID( "Wdth" );
        var idPrc = charIDToTypeID( "#Prc" );
        desc5.putUnitDouble( idWdth, idPrc, theScale );
        var idHght = charIDToTypeID( "Hght" );
        var idPrc = charIDToTypeID( "#Prc" );
        desc5.putUnitDouble( idHght, idPrc, theScale );
        var idLnkd = charIDToTypeID( "Lnkd" );
        desc5.putBoolean( idLnkd, true );
    executeAction( idPlc, desc5, DialogModes.NO );
    return myDocument.activeLayer;
    ////// open pdf //////
    function openPDF (theImage, x) {
    // define pdfopenoptions;
    var pdfOpenOpts = new PDFOpenOptions;
    pdfOpenOpts.antiAlias = true;
    pdfOpenOpts.bitsPerChannel = BitsPerChannelType.EIGHT;
    pdfOpenOpts.cropPage = CropToType.TRIMBOX;
    pdfOpenOpts.mode = OpenDocumentMode.CMYK;
    pdfOpenOpts.resolution = 10;
    pdfOpenOpts.suppressWarnings = true;
    pdfOpenOpts.usePageNumber  = true;
    // suppress dialogs;
    var theDialogSettings = app.displayDialogs;
    app.displayDialogs = DialogModes.NO;
    pdfOpenOpts.page = x;
    var thePdf = app.open(theImage, pdfOpenOpts);
    thePdf.close(SaveOptions.DONOTSAVECHANGES);
    // reset dialogmodes;
    app.displayDialogs = theDialogSettings;
    ////// turn off preference to scale placed image //////
    function turnOffRescale () {
    // determine if the resize prefernce is on;
    var ref = new ActionReference();
    ref.putEnumerated( charIDToTypeID("capp"), charIDToTypeID("Ordn"), charIDToTypeID("Trgt") );
    var appDesc = executeActionGet(ref);
    var prefDesc = appDesc.getObjectValue(charIDToTypeID( "GnrP" ));
    var theResizePref = prefDesc.getBoolean(stringIDToTypeID( "resizePastePlace" ));
    // turn off resize image during place;
    if (theResizePref == true);{
    // =======================================================
    var idsetd = charIDToTypeID( "setd" );
        var desc12 = new ActionDescriptor();
        var idnull = charIDToTypeID( "null" );
            var ref4 = new ActionReference();
            var idPrpr = charIDToTypeID( "Prpr" );
            var idGnrP = charIDToTypeID( "GnrP" );
            ref4.putProperty( idPrpr, idGnrP );
            var idcapp = charIDToTypeID( "capp" );
            var idOrdn = charIDToTypeID( "Ordn" );
            var idTrgt = charIDToTypeID( "Trgt" );
            ref4.putEnumerated( idcapp, idOrdn, idTrgt );
        desc12.putReference( idnull, ref4 );
        var idT = charIDToTypeID( "T   " );
            var desc13 = new ActionDescriptor();
            var idresizePastePlace = stringIDToTypeID( "resizePastePlace" );
            desc13.putBoolean( idresizePastePlace, false );
        var idGnrP = charIDToTypeID( "GnrP" );
        desc12.putObject( idT, idGnrP, desc13 );
    executeAction( idsetd, desc12, DialogModes.NO );
    return theResizePref
    ////// turn on preference to scale plced image //////
    function turnOnRescale (check) {
    if (check == true) {
    // =======================================================
    var idsetd = charIDToTypeID( "setd" );
        var desc14 = new ActionDescriptor();
        var idnull = charIDToTypeID( "null" );
            var ref5 = new ActionReference();
            var idPrpr = charIDToTypeID( "Prpr" );
            var idGnrP = charIDToTypeID( "GnrP" );
            ref5.putProperty( idPrpr, idGnrP );
            var idcapp = charIDToTypeID( "capp" );
            var idOrdn = charIDToTypeID( "Ordn" );
            var idTrgt = charIDToTypeID( "Trgt" );
            ref5.putEnumerated( idcapp, idOrdn, idTrgt );
        desc14.putReference( idnull, ref5 );
        var idT = charIDToTypeID( "T   " );
            var desc15 = new ActionDescriptor();
            var idresizePastePlace = stringIDToTypeID( "resizePastePlace" );
            desc15.putBoolean( idresizePastePlace, true );
        var idGnrP = charIDToTypeID( "GnrP" );
        desc14.putObject( idT, idGnrP, desc15 );
    executeAction( idsetd, desc14, DialogModes.NO );
    ////// convert to so if not one aready //////
    function duplicateAndOffset (theLayer, theXOffset, theYOffset) {
    app.activeDocument.activeLayer = theLayer;
    // =======================================================
    var idcopy = charIDToTypeID( "copy" );
        var desc9 = new ActionDescriptor();
        var idnull = charIDToTypeID( "null" );
            var ref5 = new ActionReference();
            var idLyr = charIDToTypeID( "Lyr " );
            var idOrdn = charIDToTypeID( "Ordn" );
            var idTrgt = charIDToTypeID( "Trgt" );
            ref5.putEnumerated( idLyr, idOrdn, idTrgt );
        desc9.putReference( idnull, ref5 );
        var idT = charIDToTypeID( "T   " );
            var desc10 = new ActionDescriptor();
            var idHrzn = charIDToTypeID( "Hrzn" );
            var idRlt = charIDToTypeID( "#Pxl" );
            desc10.putUnitDouble( idHrzn, idRlt, theXOffset );
            var idVrtc = charIDToTypeID( "Vrtc" );
            var idRlt = charIDToTypeID( "#Pxl" );
            desc10.putUnitDouble( idVrtc, idRlt, theYOffset );
        var idOfst = charIDToTypeID( "Ofst" );
        desc9.putObject( idT, idOfst, desc10 );
    executeAction( idcopy, desc9, DialogModes.NO );
    return app.activeDocument.activeLayer
    ////// load pdf as smart object //////
    function transformLayer (layer, percentage, xOffset, yOffset) {
    app.activeDocument.activeLayer = layer;
    // =======================================================
    var idTrnf = charIDToTypeID( "Trnf" );
        var desc4 = new ActionDescriptor();
        var idFTcs = charIDToTypeID( "FTcs" );
        var idQCSt = charIDToTypeID( "QCSt" );
        var idQcsa = charIDToTypeID( "Qcsa" );
        desc4.putEnumerated( idFTcs, idQCSt, idQcsa );
        var idOfst = charIDToTypeID( "Ofst" );
            var desc5 = new ActionDescriptor();
            var idHrzn = charIDToTypeID( "Hrzn" );
            var idPxl = charIDToTypeID( "#Pxl" );
            desc5.putUnitDouble( idHrzn, idPxl, xOffset );
            var idVrtc = charIDToTypeID( "Vrtc" );
            var idPxl = charIDToTypeID( "#Pxl" );
            desc5.putUnitDouble( idVrtc, idPxl, yOffset );
        var idOfst = charIDToTypeID( "Ofst" );
        desc4.putObject( idOfst, idOfst, desc5 );
        var idWdth = charIDToTypeID( "Wdth" );
        var idPrc = charIDToTypeID( "#Prc" );
        desc4.putUnitDouble( idWdth, idPrc, percentage );
        var idHght = charIDToTypeID( "Hght" );
        var idPrc = charIDToTypeID( "#Prc" );
        desc4.putUnitDouble( idHght, idPrc, percentage );
        var idLnkd = charIDToTypeID( "Lnkd" );
        desc4.putBoolean( idLnkd, true );
        var idAntA = charIDToTypeID( "AntA" );
        desc4.putBoolean( idAntA, true );
    executeAction( idTrnf, desc4, DialogModes.NO );
    return app.activeDocument.activeLayer
    ////// function to get file’s dimensions, thanks to michael l hale //////
    function getDimensions( file ){
    function divideString (theString) {
              theString = String(theString);
        var a = Number(theString.slice(0, theString.indexOf("\/")));
        var b = Number(theString.slice(theString.indexOf("\/") + 1));
        return (a / b)
    // from a script by michael l hale;
    function loadXMPLibrary(){
         if ( !ExternalObject.AdobeXMPScript ){
              try{
                   ExternalObject.AdobeXMPScript = new ExternalObject
                                                                ('lib:AdobeXMPScript');
              }catch (e){
                   alert( ErrStrs.XMPLIB );
                   return false;
         return true;
    function unloadXMPLibrary(){
       if( ExternalObject.AdobeXMPScript ) {
          try{
             ExternalObject.AdobeXMPScript.unload();
             ExternalObject.AdobeXMPScript = undefined;
          }catch (e){
             alert( ErrStrs.XMPLIB );
    ////// based on a script by muppet mark //////
    function dimensionsShellScript (file) {
              try {
    // getMetaDataMDLS;
    if (File(file) instanceof File && File(file).exists) {
              var shellString = "/usr/bin/mdls ";
              shellString += File(file).fsName;
    //          shellString += File(file).fullName;
              shellString += ' > ~/Documents/StdOut2.txt';
              app.system(shellString);
    // read the file;
    if (File('~/Documents/StdOut2.txt').exists == true) {
        var file = File('~/Documents/StdOut2.txt');
        file.open("r");
        file.encoding= 'BINARY';
        var theText = new String;
        for (var m = 0; m < file.length; m ++) {
                        theText = theText.concat(file.readch());
              file.close();
              theText = theText.split("\n");
    // get the dimensions;
              var dim = new Array;
              for (var m = 0; m < theText.length; m++) {
                        var theLine = theText[m];
                        if (theLine.indexOf("kMDItemPixelWidth") != -1) {dim.push(theLine.match(/[\d\.]+/g).join("") )}
                        if (theLine.indexOf("kMDItemPixelHeight") != -1) {dim.push(theLine.match(/[\d\.]+/g).join("") )}
                        if (theLine.indexOf("kMDItemResolutionWidthDPI") != -1) {dim.push(theLine.match(/[\d\.]+/g).join("") )}
                        if (theLine.indexOf("kMDItemResolutionHeightDPI") != -1) {dim.push(theLine.match(/[\d\.]+/g).join("") )}
    // remove file and hand back;
              File('~/Documents/StdOut2.txt').remove();
    catch (e) {
              if (File('~/Documents/StdOut2.txt').exists == true) {File('~/Documents/StdOut2.txt').remove()};
              return dim
              try{
                        loadXMPLibrary();
                        var xmpf = new XMPFile( file.fsName, XMPConst.UNKNOWN, XMPConst.OPEN_FOR_READ );
                        var xmp = xmpf.getXMP();
                        xmpf.closeFile();
                        var resolutionUnit = xmp.getProperty( XMPConst.NS_TIFF, 'ResolutionUnit', XMPConst.STRING);
                        var resFactor = 1;
                        if (resolutionUnit == 2) {
                                  var resFactor = 1;
                        if (resolutionUnit == 3) {
                                  var resFactor = 2.54;
                        var dim = [xmp.getProperty( XMPConst.NS_EXIF, 'PixelXDimension', XMPConst.STRING),
                        xmp.getProperty( XMPConst.NS_EXIF, 'PixelYDimension', XMPConst.STRING),
                        divideString (xmp.getProperty( XMPConst.NS_TIFF, 'XResolution', XMPConst.STRING)) * resFactor,
                        divideString (xmp.getProperty( XMPConst.NS_TIFF, 'YResolution', XMPConst.STRING)) * resFactor];
                        unloadXMPLibrary();
                        if(dim[0]=="undefined" || dim[1]=="undefined"){
                var dim = undefined;
                var res = undefined;
                var bt = new BridgeTalk;
                bt.target = "bridge";
                var myScript = ("var ftn = " + psRemote.toSource() + "; ftn("+file.toSource()+");");
                bt.body = myScript;
                bt.onResult = function( inBT ) {myReturnValue(inBT.body); }
                bt.send(10);
                        function myReturnValue(str){
                                  res = str;
                                  dim = str.split(',');
                        function psRemote(file){
                                  var t= new Thumbnail(file);
                                  return t.core.quickMetadata.width+','+t.core.quickMetadata.height;
        }catch(e){unloadXMPLibrary()};
              if (String(dim[2]).indexOf("\/") != -1) {
                        var a = divideString(dim[2]);
                        var b = divideString(dim[3]);
                        dim = [dim[0], dim[1], a, b]
    // if dimensions are missing as might be the case with some bitmap tiffs for example try a shell-script;
              if (dim[0] == undefined || dim[1] == undefined) {
                        var array = dimensionsShellScript(file);
                        dim = array;
    // if shell-string failed open doc to get measurements;
              if (dim[0] == undefined || dim[1] == undefined) {
                        var thisDoc = app.open (File(file));
    // close ai without saving;
                        if (file.name.slice(-3).match(/\.(ai)$/i)) {
                                  thisDoc.trim(TrimType.TRANSPARENT);
                                  var dim = [thisDoc.width, thisDoc.height, thisDoc.resolution, thisDoc.resolution];
                                  thisDoc.close(SaveOptions.DONOTSAVECHANGES)
                        else {
                                  var dim = [thisDoc.width, thisDoc.height, thisDoc.resolution, thisDoc.resolution];
                                  thisDoc.close(SaveOptions.PROMPTTOSAVECHANGES)
    return dim;

  • Resizing an image and displaying

    hi all,
    i am new to graphics,
    i want to resize the image (say w=300,h=300) before displaying to panel,
    i tried in the following code but no help? is this current way?
    in imagepanel class i am calling *"resize(image,300,300)"*. i don't know is that current way of doing, please help me to solve this problem or give any suggestion.
    import java.awt.Dimension;
    import java.awt.Graphics;
    import java.awt.Graphics2D;
    import java.awt.RenderingHints;
    import java.awt.image.BufferedImage;
    import java.io.File;
    import javax.imageio.ImageIO;
    import javax.swing.JFrame;
    import javax.swing.JPanel;
    public class drawImage extends JFrame {
        BufferedImage orignalImage = null;
        public drawImage() {
            try {
                orignalImage = ImageIO.read(new File("C:\\Documents and Settings\\Shafi\\Desktop\\daya\\ballot\\01000361FU-0003V01.jpg"));
            } catch (Exception e) {
                e.printStackTrace();
            imagepanel imp = new imagepanel(orignalImage, 5, 5);
            //imp.resize(imp, 200,200);
            getContentPane().add(imp);
            pack();
            setVisible(true);
            setDefaultCloseOperation(EXIT_ON_CLOSE);
        public static void main(String[] arg) {
            new drawImage();
    class imagepanel extends JPanel {
        private BufferedImage image;
        int x;
        int y;
        public imagepanel(BufferedImage image, int x, int y) {
            super();
            this.image = image;
            this.x = x;
            this.y = y;
            image = resize(image,300,300);
            setPreferredSize(new Dimension(image.getWidth(), image.getHeight()));
       public BufferedImage resize(BufferedImage img, int newW, int newH) { 
            int w = img.getWidth(); 
                int h = img.getHeight(); 
                BufferedImage  dimg = new BufferedImage(newW, newH, img.getType()); 
                Graphics2D g = dimg.createGraphics(); 
                g.setRenderingHint(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BILINEAR); 
                g.drawImage(img, 0, 0, newW, newH, 0, 0, w, h, null); 
                g.dispose(); 
                return dimg; 
        @Override
        protected void paintComponent(Graphics g) {
            super.paintComponent(g);
            g.drawImage(image, x, y, null);
    }thanks
    dayananda b v

    Hey friend try this out.
    public static boolean createThumbnail(String selectedCategoryName, String imagePath, String imageName){
    //imagePath=full image path
    //imageName=name of the image(Eg:input.jpg)
    try {
    int thumbHeight=100;
    int thumbWidth =100;
    Image image = Toolkit.getDefaultToolkit().getImage(imagePath+"/"+imageName);
    MediaTracker mediaTracker = new MediaTracker(new Container());
    mediaTracker.addImage(image, 0);
    mediaTracker.waitForID(0);
    double thumbRatio = (double)thumbWidth / (double)thumbHeight;
    if(thumbRatio < 1){
    thumbRatio = (double)thumbHeight / (double)thumbWidth;
    int imageWidth = image.getWidth(null);
    int imageHeight = image.getHeight(null);
    int temp=0;
    if(thumbHeight <= imageHeight || thumbWidth <= imageWidth){
    double imageRatio = (double)imageWidth / (double)imageHeight;
    if (thumbRatio < imageRatio) {
    thumbHeight = (int)(thumbWidth / imageRatio);
    } else {
    thumbWidth = (int)(thumbHeight * imageRatio);
    }else if(thumbHeight > imageHeight && thumbWidth > imageWidth){
    thumbWidth = imageWidth + 5;
    thumbHeight = imageHeight + 5;
    // draw original image to thumbnail image object and
    // scale it to the new size on-the-fly
    BufferedImage thumbImage = new BufferedImage(thumbWidth,
    thumbHeight, BufferedImage.TYPE_INT_RGB);
    Graphics2D graphics2D = thumbImage.createGraphics();
    graphics2D.setRenderingHint(RenderingHints.KEY_INTERPOLATION,
    RenderingHints.VALUE_INTERPOLATION_BILINEAR);
    graphics2D.drawImage(image, 0, 0, thumbWidth, thumbHeight, null);
    // save thumbnail image to OUTFILE
    BufferedOutputStream out = null;
    out = new BufferedOutputStream(new
    FileOutputStream(imagePath+"/preview_"+ imageName));
    JPEGImageEncoder encoder = JPEGCodec.createJPEGEncoder(out);
    JPEGEncodeParam param = encoder.
    getDefaultJPEGEncodeParam(thumbImage);
    int quality = 100;//Integer.parseInt(args[4]);
    quality = Math.max(0, Math.min(quality, 100));
    param.setQuality((float)quality / 100.0f, false);
    encoder.setJPEGEncodeParam(param);
    encoder.encode(thumbImage);
    image.flush();
    thumbImage.flush();
    out.flush();
    out.close();
    mediaTracker.removeImage(image);
    mediaTracker = null;
    thumbImage = null;
    image = null;
    encoder = null;
    graphics2D = null;
    System.out.println("Successfully Created Thumbnail.");
    return true;
    } catch (IOException ioe){
    System.out.println("IO Error in writing the thumbnail:"+ ioe.getMessage());
    return false;
    } catch (Exception e){
    System.out.println("Error in writing the thumbnail:"+ e.getMessage());
    return false;
    Regards..

  • Resizing an image for a Wordpress Theme

    I am creating a website/blog on Pro PhotoBlog and the Masthead of the theme I am using requires my image to be 990 pixels wide. I have entered the dimensions of what I wanted (990x600 pixels) on the Aperture export screen. When I import the image into Pro Photoblog, its saying its 826x600 which is an incorrect size! What's causing my export to change dimensions? The original size of my images are way big so resizing them down to 990x600 should not be an issue unless I am missing something.
    The instructions Pro Photo gives is to use Photoshop to resize the images before uploading them but why do that when I can do it in Aperture.

    Expanding a little on Munas' spot-on answers.  Note that the wording of the control in the Image Export Preset dialog is "Size to➞Fit within (pixels)".  This means that Aperture will not change the aspect ratio of your Image, it will shrink it so that it _fits within_ the dimensions you specify.  When you specify 990 x 600, you are telling Aperture to shrink the Image _proportionately_ (that is, with the same aspect ratio) until it fits within a rectangle that size.  Your Image is, apparently, not rectangular enough to _exactly_ be 990 x 600 when the width is 990 _or less_ AND the height is 600 _or less_.
    As Munas says, you must _start with_ an Image that has an aspect ratio equal to 990/600 in order to end up with an Image that is 990 x 600 when it is resized to fit within 990 x 600.  To get an image that has that aspect ratio, you need to crop an area with that aspect ratio.  I suggest creating a new Version from an Image you want to use, and then cropping with the crop tool set to "Aspect Ratio➞Custom" and "Width➞990" and "Height➞600".

  • Resizing an image button

    When inserting an image button in a Captivate project, I'm
    not able to resize it like I can with a text button. Is it possible
    to resize an image button?

    Hi Jay
    The image buttons are always presented at the size of the
    images you used. To change them, you need to take the images you
    used and open them in an image editing application. Then size them
    as desired. When you use them to create an Image Button after doing
    this, the Button will present at the new Image size.
    Cheers... Rick

  • Resizing an image in iPhoto - HOW?

    iPhoto 09 is a pretty miserable application.
    Does anyone know how to simply resize an image - to a specific size - without having to mail or upload it with iPhoto's best guess for the chosen output?

    Selecting the CROP and CUSTOM constraint crops the image. I am NOT trying to CROP the image, just make the ENTIRE image smaller.
    If you are not trying to Crop the image, why are you selecting Crop?
    let's talk about storing and sorting by DIRECTORY. Date, Keyword, Title, Rating, Manual - WHAT? How about directory/folder?
    You’re rather missing the entire point of iPhoto. The aim is to organise your Photos quite independent of the location of your files. It’s a key distinction, and if you’re not happy with it then iPhoto is not the app for you.
    Once you import the files to iPhoto, forget about them. Use the iPhoto Window and therein you can do everything you need to do with your photos. Then, want to access the files:
    There are many, many ways to access your files in iPhoto:
    *For Users of 10.5 Only*
    You can use any Open / Attach / Browse dialogue. On the left there's a Media heading, your pics can be accessed there. Apple-Click for selecting multiple pics.
    Uploaded with plasq's Skitch!
    You can access the Library from the New Message Window in Mail:
    Uploaded with plasq's Skitch!
    *For users of 10.4 and 10.5* ...
    Many internet sites such as Flickr and SmugMug have plug-ins for accessing the iPhoto Library. If the site you want to use doesn’t then some, one or any of these will also work:
    To upload to a site that does not have an iPhoto Export Plug-in the recommended way is to Select the Pic in the iPhoto Window and go File -> Export and export the pic to the desktop, then upload from there. After the upload you can trash the pic on the desktop. It's only a copy and your original is safe in iPhoto.
    This is also true for emailing with Web-based services. However, if you're using Gmail you can use iPhoto2GMail
    If you use Apple's Mail, Entourage, AOL or Eudora you can email from within iPhoto.
    If you use a Cocoa-based Browser such as Safari, you can drag the pics from the iPhoto Window to the Attach window in the browser.
    *If you want to access the files with iPhoto not running*:
    Create a Media Browser using Automator (takes about 10 seconds) or use this free utility Karelia iMedia Browser
    Other options include:
    1. *Drag and Drop*: Drag a photo from the iPhoto Window to the desktop, there iPhoto will make a full-sized copy of the pic.
    2. *File -> Export*: Select the files in the iPhoto Window and go File -> Export. The dialogue will give you various options, including altering the format, naming the files and changing the size. Again, producing a copy.
    3. *Show File*: Right- (or Control-) Click on a pic and in the resulting dialogue choose 'Show File'. A Finder window will pop open with the file already selected.
    You can set Photoshop (or any image editor) as an external editor in iPhoto. (Preferences -> General -> Edit Photo: Choose from the Drop Down Menu.) This way, when you double click a pic to edit in iPhoto it will open automatically in Photoshop or your Image Editor, and when you save it it's sent back to iPhoto automatically. This is the only way that edits made in another application will be displayed in iPhoto.
    Regards
    TD

  • Bridge Exports Changes Resolution from 300 to 72 dpi, resizing my image

    I like to use Bridge (CS5) to export my photographs for printing, and frequently I will use the Export feature to resize the images (e.g., 5x7 vs full size), but every time I export it recharacterizes the images as 72 dpi, vs the 300 dpi I prefer. 
    Consistent with some of the previous postings (~2 yrs ago) I have seen on this topic the exported images are now "sized" much bigger (29"x20" for what should have been ~5"x7"), and hence expectantly I haven't lost any resolution, but it's aggrevating to have the dpi changed.
    Can anyone tell me how to export without having the dpi changed?
    And while I'm at it, can anyone confirm that I'm not loosing image resolution?
    Thanks so much!!

    Can anyone tell me how to export without having the dpi changed?
    Can't find any other settings to change and just having tested it I can confirm that it sets ppi (it is pixels per inch -ppi- for a digital file which is made from pixels and dots per inch -dpi- from the ink dots of a print ) to 72.
    And while I'm at it, can anyone confirm that I'm not loosing image resolution?
    You already stated yourself that you did not loose pixels, therefor the size of the files stays the same. It is just a mater of figures. 300 ppi means a larger concentration per inch and 72 pixels per inch means a smaller concentration of pixels per inch. Given the same amount of pixels for both settings this means a smaller image dimension for 300 ppi and a larger image dimension for the 72 ppi.
    300 ppi is some 'magic' number from printed press, but it really depends on the need of the job related printing machine. If you have a small image and need to look closely it should have a larger concentration per inch to reflect its sharpness.
    However theoretically you would almost have the same visible quality when printed on 72 at billboard sizes. That's because you always have a large distance between your eyes and the bill board. If you look closely you will see the dots (because the billboard is a product of ink dots…) but of course it is not meant to study at that close range.
    The same is for judging sharpness on your computer. Ideally you do so at 100 % for correct judgement at real size pixels. But in reality there will be almost no situation you will study a print at that same distance
    Any thoughts on why these would be different?   And am I fretting over things unncessarily?
    Only guesses, the use a different algorithm or calculation scheme, in my case I tried a Canon Raw (converted to DNG) without any ACR settings then the basics applied and found that Bridge export jpeg 11 creates larger files then using PS.
    But there are some other concerns I have and that certainly would make me fretting in use of export module:
    First of all I almost never use it, merely in this cases for testing, because using the menu tools give a shortcut to Photoshop / Batch and inhere I have created several dedicated resizing and resaving actions that also places the files in preset folders.
    But with this small test I found out that
    a: it changes ppi to 72 ppi, not a very big deal but I did not asked for it nor did I wanted it.
    b: it converts my Adobe RGB color space to sRGB and I certainly did not want that without my explicit wish for this conversion, so this is more then a bit worrying to my concern.
    c: it seems to apply a sharpness that I certainly did not want to happen without my knowledge, and this rules the use of the export module out completely.
    Since I only tried a DNG file without settings or retouch/developing  in Photoshop the jpeg generated by PS was not very sharp. This makes sense to me because I have set my basic ACR to apply sharpening only to preview. There are a lot of different sharpening theories around but I use one in PS itself. So I was a bit shocked to learn that the export module did all those for me unwanted and not adjustable settings putting me completely out of control…
    So if you want to have full control about things happening under the hood yourself just start creating actions in PS, it is very easy to record an action and even more easier to play it. Instead of every time dragging files to export module and always recheck the image options (it seems to reset itself always to jpeg quality 8 on my system) only select the files you want to resize and choose menu tool / Photoshop Batch and select the wanted action. hit OK and your almost done, PS does the rest.
    The great thing of the latest PS CS6 action pallet is the extension with a so called 'insert conditional' that let's you create an 'if - then else' action for both landscape and portrait resizing actions so you don't need the 'constrain to fit' or 'fit image' option. Just once create an action for both resizing dimensions and then create a new action with insert conditional. choose If image is landscape play action…. / else play action….
    It is really a very productive way. I have a lot of actions (organized in sets for better overview) and even one that creates 4 different sizes in 4 different folders using 1 go in Bridge

  • Resizing JPEG images

    Hey guys,
    I have the following code:
    public static void resize(String original, String resized, int size,
                                  int dimension, float factor)
                throws Exception
            if ((dimension != HEIGHT) && (dimension != WIDTH))
                dimension = WIDTH;
            try
                // get original image
                Image originalImage = new ImageIcon(original).getImage();
                Image resizedImage = null;
                int imageWidth = originalImage.getWidth(null);
                int imageHeight = originalImage.getHeight(null);
                if (dimension == WIDTH)
                    resizedImage = originalImage.getScaledInstance(
                            size, (size * imageHeight) / imageWidth,
                            Image.SCALE_SMOOTH);
                else
                    resizedImage = originalImage.getScaledInstance(
                            (size * imageWidth) / imageHeight, size,
                            Image.SCALE_SMOOTH);
                // this code ensures that all the pixels in the image are loaded
                Image temp = new ImageIcon(resizedImage).getImage();
                // create the buffered image
                BufferedImage bufferedImage = new
    BufferedImage(temp.getWidth(null),
                        temp.getHeight(null), BufferedImage.TYPE_INT_RGB);
                // copy image to buffered image
                Graphics g = bufferedImage.createGraphics();
                // clear background and paint the image
                g.setColor(Color.white);
                g.fillRect(0, 0, temp.getWidth(null), temp.getHeight(null));
                g.drawImage(temp, 0, 0, null);
                g.dispose();
                // sharpen/soften (depending on factor (-ve for sharpening, +ve
    for softening)
                float[] array = {0, factor, 0, factor, 1 - (factor * 4),
                    factor, 0, factor, 0};
                Kernel kernel = new Kernel(3, 3, array);
                ConvolveOp cOp = new ConvolveOp(kernel, ConvolveOp.EDGE_NO_OP,
    null);
                bufferedImage = cOp.filter(bufferedImage, null);
                // write the jpeg to a file
                OutputStream out = new FileOutputStream(resized);
                // encodes image as a JPEG data stream
                JPEGImageEncoder encoder = JPEGCodec.createJPEGEncoder(out);
                com.sun.image.codec.jpeg.JPEGEncodeParam param =
    encoder.getDefaultJPEGEncodeParam(bufferedImage);
                param.setQuality(0.7f, true);
                encoder.setJPEGEncodeParam(param);
                encoder.encode(bufferedImage);
            catch (Exception e)
                throw e;
        }which I use for making thumbnails and resizing images uploaded to my site. Thumbnails work fine (possibly due to the smaller size) but when I resize an image I get lots of horizontal lines across resized image.
    The funny think is that when I use this method just in a simple application, running directly under JDK 1.4.1_02 then everything works fine and images turn out fine.
    When the above code runs as a part of my web application, thumbnails work, but larger images end up with the lines across them.
    Any ideas??
    I thought it might have had something to do with the factor parameter I use so I tested it just using 0.0 and the same problem occurs.
    I run Apache 2.0.44 with Tomcat 4.1.18, which by the way also runs with JDK 1.4.1_02 so JDK is not the problem.
    Any help is greatly appreciated.
    Cheers,
    Tom

    hey tom,
    i also use this code and also had these problems. i solved it by adding just one line after your if-else: originalImage.flush();
    else {
    resizedImage = originalImage.getScaledInstance (size * imageWidth)/imageHeight, size, Image.SCALE_SMOOTH);
    originalImage.flush();
    // this code ensures that all the pixels in the image are loaded
    Image temp = new ImageIcon(resizedImage).getImage();
    .

  • I want resize the image and set position after retrieving from oracle datab

    How can I display image on web page after retrieving it from oracle database. Display is not problem but resize that image and position is very dificult .Please send me Guideline about blob object todisplay and resize it in web pages

    I tried to do the suggetion made by you but I was not able to solve the issue. I think I am close to it and with your help I should be able to resolve it. Let me explain you the brief about this issue.
    1. Another group uses Oracle Apex to load the images in to the database.
    2. I am fetching this data fron Oracle and displays in to Webpage using PHP.
    This is so far I tried. Please bear with me if I am doing anything wrong.
    1.I created program.php which calls the <IMG> as suggested by you.Snippet of the code is
    <div><img src="/oracle/image_story.php" alt="Image Stories" width="900" height="500" /></div>
    2. In the image_story.php, I used the following code.
    <?php
    $query = "SELECT *
              FROM IMAGE_STORY WHERE image_id = 50";
    if ($result = run_oracle($query, 'select')) { // Run the query.
         $num_results = count($result);
         if ($num_results > 0) {
         foreach($result as $row){
              $img = $row['DOCUMT']->load();
              header("Content-type: image/pjpeg");
              echo $img;
              //echo '<div><img src="'.$img.'" alt="Image Stories" width="900" height="500" /></div>';
    ?>
    When I run the program.php,Image is not displayed and it is showing as "X". To troubleshoot the issue,I run the image_story.php and echo $img is giving me the weird character like,
    "ÿØÿàJFIFddÿìDuckyPÿîAdobedÀÿÛ„          
    I used PL/SQL developer as a client to access the BLOB field from the database and in the HTML view, it is giving me the same output.
    Select * from image_story a where a.image_id = 50
    I am not sure the issue is with the MIME-TYPE,ENCODING or I am missing something here. I tried lot of Content-Type.
    Please guide me.

Maybe you are looking for