Applescript to change image resolution using image events

Does anyone have an applescript to change image resolution using image events in OSX? I want to optimize my images for iWeb. I want to use a shell script in an applescript as a droplet or as a service in Automator. I'd like to leave the original intact.

For what type of use in iWeb are these photos intended? If it's for adding to a page (not a photo or album page) iWeb does a great job of optimizing. See my post in this topic: Re: Photo Resolution in iWeb.
You can optimize an entire site with an application like Web Site Maestro. It can reduce the site's size by up to 49%. Here's the settings available for the optimization:
Click to view full size
It's very effective.
OT

Similar Messages

  • Change image resolution using image events

    Does anyone have an applescript to change image resolution using image events in OSX? I want to optimize my images for iWeb. I want to use a shell script in an applescript as a droplet or as a service in Automator. I'd like to leave the original intact.

    No? Oh...ok den. No Applescripts at all.

  • How to view the image by using mousedrag event?

    How can i move the full image by using mousedrag event(not using scrollBar and the frame should not reziable).
    e.g
    click the mouse in image and drag right side or towards down,the image should move to till the end in width or height
    import java.awt.*;
    import java.awt.event.MouseEvent;
    import java.awt.event.MouseMotionListener;
    import java.awt.image.BufferedImage;
    import java.io.*;
    import javax.imageio.ImageIO;
    import javax.swing.*;
    public class LoadAndShow extends JPanel implements MouseMotionListener{
        BufferedImage image;
        Dimension size = new Dimension();
        public LoadAndShow(BufferedImage image) {
            this.image = image;
            size.setSize(image.getWidth(), image.getHeight());
         * Drawing an image can allow for more
         * flexibility in processing/editing.
        protected void paintComponent(Graphics g) {
            // Center image in this component.
            int x = (getWidth() - size.width)/2;
            int y = (getHeight() - size.height)/2;
            g.drawImage(image, x, y, this);
        public Dimension getPreferredSize() { return size; }
        public static void main(String[] args) throws IOException {
             //set the image path
            String path = "Images/dinette.jpg";
            BufferedImage image = ImageIO.read(new File(path));
            LoadAndShow test = new LoadAndShow(image);
            JFrame f = new JFrame();
            f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            f.setResizable(false);
            f.add(test);
            f.setSize(400,400);
            f.setLocation(200,200);
            f.setVisible(true);
            //showIcon(image);
         * Easy way to show an image: load it into a JLabel
         * and add the label to a container in your gui.
        private static void showIcon(BufferedImage image) {
            ImageIcon icon = new ImageIcon(image);
         public void mouseDragged(MouseEvent arg0)
              // TODO drag the image
         public void mouseMoved(MouseEvent arg0)
    }

    Following is the updated code for image move on mouse move.
    import java.awt.*;
    import java.awt.event.MouseEvent;
    import java.awt.event.MouseMotionListener;
    import java.awt.image.BufferedImage;
    import java.io.*;
    import javax.imageio.ImageIO;
    import javax.swing.*;
    import java.awt.event.MouseListener; public class LoadAndShow extends JPanel implements MouseMotionListener,MouseListener{
    BufferedImage image;
    Dimension size = new Dimension();
    Point pt;//Maintain the Current Pressed Values of Mouse
    Rectangle rect;//Maintain the moving position of Mouse     public LoadAndShow(BufferedImage image)     {
    this.image = image;
    size.setSize(image.getWidth(), image.getHeight());
    this.addMouseListener(this);
    this.addMouseMotionListener(this);
    * Drawing an image can allow for more
    * flexibility in processing/editing.
    protected void paintComponent(Graphics g) {
    // Center image in this component.
    int x = (getWidth() - size.width)/2;
    int y = (getHeight() - size.height)/2;
    g.drawImage(image, x, y, this);
    }     public Dimension getPreferredSize() { return size; }     public static void main(String[] args) throws IOException {
    //set the image path
    String path = "C:\\Documents and Settings\\All Users\\Documents\\My Pictures\\Sample Pictures\\Winter.jpg";
    BufferedImage image = ImageIO.read(new File(path));
    LoadAndShow test = new LoadAndShow(image);
    JFrame f = new JFrame();
    f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    f.setResizable(false);
    f.add(test);
    f.setSize(400,400);
    f.setLocation(200,200);
    f.setVisible(true);
    //showIcon(image);
    * Easy way to show an image: load it into a JLabel
    * and add the label to a container in your gui.
    private static void showIcon(BufferedImage image) {
    ImageIcon icon = new ImageIcon(image);
    }     public void mouseClicked(MouseEvent e) {
    }     public void mousePressed(MouseEvent e) {
    pt = e.getPoint();
    rect = this.getBounds();
    }     public void mouseReleased(MouseEvent e) {
    }     public void mouseEntered(MouseEvent e) {
    }     public void mouseExited(MouseEvent e) {
    }     public void mouseDragged(MouseEvent e) {
    Point p=e.getPoint();
    moveImageOnMouseMove(p);
    }     public void mouseMoved(MouseEvent e) {
    * This Function is used for calculate the Dragging point of Mouse and set the image on particular points
    * @param p Point hold the dragging point of Mouse
    private void moveImageOnMouseMove(Point p)
    int xDelta = p.x - pt.x;
    int yDelta = p.y - pt.y;
    rect.x = rect.x + xDelta;
    rect.y = rect.y + yDelta;
    this.setLocation(rect.x, rect.y);
    this.repaint();
    }}   If you have any query related with the code please let me know.
    Manish L
    MS Technology
    www.ms-technology.com
    Edited by: mannymst on Sep 18, 2008 5:53 AM
    Edited by: mannymst on Sep 18, 2008 6:05 AM

  • Downgrading Image Resolution Using JAI

    I am interested in downgrading the resolution of TIFF images that I am inserting into a PDF to reduce the document's file size. The TIFF images are either CCITT G4 bitonal or JPEG RGB. What would be the best approach to doing this using JAI?
    I appreciate any suggestions.
    Youssef Eldakar
    Bibliotheca Alexandrina

    Youssef
    The following code will load a TIFF image (or JPEG or some other formats that I can't remember) into a PlanarImage object and then rescale it according to the scale factors and then save as a TIFF.
    For example if you wanted to change a 320 x 240 image to a 160 x 120 use xScaleFactor and yScaleFactor of 0.5.
      public static PlanarImage rescale(String inputFilename, String outputFilename, float xScaleFactor, float yScaleFactor)
            // load the image from the file
            PlanarImage image = JAI.create("fileload", inputFilename);
            ParameterBlock rescaleParameters = new ParameterBlock();
            rescaleParameters.addSource(image);
            rescaleParameters.add(xScaleFactor);
            rescaleParameters.add(yScaleFactor);
            // saving as TIFF is a little more complicated than loading
            try
                FileOutputStream out = new FileOutputStream(outputFilename);
                TIFFEncodeParam parameters = new TIFFEncodeParam();
                ImageEncoder encoder = ImageCodec.createImageEncoder("TIFF", out, parameters);
                try
                    encoder.encode(image);
                    out.close();
                catch (IOException e)
                    System.out.println("Failed to encode the image");
            catch (java.io.FileNotFoundException ioEx)
                System.out.println("Could not write to file " + filename);

  • Applescript to change file type using folder action

    Just found out my Adobe Acrobat is saving PDFs with the filetype "FDP" and creator "ORAC" which is obviously the reverse of what they should be.
    There doesn't appear to be a fix for this, and for me it's a problem because when I copy these PDFs onto our Xinet WebNative asset management server the files aren't recognised as PDFs, so don't display a preview in the web page.
    So, I wanted to use a folder action that will set the Creator and Type to the PDFs whenever they are put into a folder on the server.
    Unfurtunately, although I can get this to work when using a script in the form of an application (so I drop PDFs onto it, I cannot get it to work as a folder action. It doesn't set the creator and type even though the same commands in a application script do work.
    *This is the code to my script which works fine as an application:*
    ====================
    property FileType : ""
    property CreatorType : ""
    on open theFiles
    tell application "Finder"
    activate
    set FileType to "PDF "
    set CreatorType to "CARO"
    repeat with eachFile in theFiles
    set the file type of eachFile to FileType
    set the creator type of eachFile to CreatorType
    end repeat
    end tell
    end open
    ===================
    *and this is what I'm trying to use for a folder action:*
    ===================
    on adding folder items to my_folder after receiving the_files
    set pdfs to {"pdf"}
    repeat with i from 1 to number of items in the_files
    tell application "Finder"
    set this_file to (item i of the_files)
    set the file_path to the quoted form of the POSIX path of this_file
    --set the file_path2 to the quoted form of file_path --can combine if file_path isn't needed
    set this_fileType to name extension of (info for this_file)
    end tell
    if this_fileType is in pdfs then
    tell application "Finder"
    activate
    set FileType to "PDF "
    set CreatorType to "CARO"
    end tell
    end if
    end repeat
    end adding folder items to
    ==================
    I know it processes the file but it doesn't actually change the creator type.
    *If only Apple would fix this bug in the first place!*

    Your folder action script isn't using the same commands, and doesn't do anything about setting file types or creator codes at all. Something like this should do the trick:
    <pre style="
    font-family: Monaco, 'Courier New', Courier, monospace;
    font-size: 10px;
    font-weight: normal;
    margin: 0px;
    padding: 5px;
    border: 1px solid #000000;
    width: 720px;
    color: #000000;
    background-color: #FFEE80;
    overflow: auto;"
    title="this text can be pasted into the Script Editor">
    on adding folder items to my_folder after receiving the_files
    set pdfs to {"pdf"}
    repeat with each_file in the_files
    set this_fileType to name extension of (info for each_file)
    if this_fileType is in pdfs then
    tell application "Finder"
    set file type of each_file to "PDF "
    set creator type of each_file to "CARO"
    end tell
    end if
    end repeat
    end adding folder items to
    </pre>
    ... and by the way, Apple doesn't have anything to do with the file types, creator codes, or other application specific settings that an Adobe application sets for itself.

  • Changing  between pages using jsr286 events.

    Hello,
    I am trying to implement inter portlet communication between 2 portlets which reside on 2 different pages using JSR 286 implementation.
    I added supported-publishing-event and supported-processing-event in portlet.xml and able to fire the event from portlet A and able to handle the event in portlet B. However I am unable to navigate to page where portlet b resides. After handling the event, portal still displays the portlet A page.
    How do I tell portal container to switch page while processing event?
    Any help appreciated.

    Hello,
    There is no "standard" mechanism for doing this from JSR286 portlets-- the JSR286 specification doesn't deal with the concept of portlets on other pages, or how to switch pages.
    However, WebLogic Portal has a mechanism for doing exactly what you want to do. You'll need to create a file in your webapp with a ".portlet" extension, which looks like this:
    <?xml version="1.0" encoding="UTF-8"?>
    <portal:root xmlns:netuix="http://www.bea.com/servers/netuix/xsd/controls/netuix/1.0.0" xmlns:portal="http://www.bea.com/servers/netuix/xsd/portal/support/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.bea.com/servers/netuix/xsd/portal/support/1.0.0 portal-support-1_0_0.xsd">
        <netuix:javaPortlet definitionLabel="portletNameFromPortletXml" title="sample portlet">
            <netuix:handleCustomEvent qname="{event.namespace}eventLocalPart">
                <netuix:activatePage/>
            </netuix:handleCustomEvent>
        </netuix:javaPortlet>
    </portal:root>The "portletNameFromPortletXml" is the portlet-name as declared in your WEB-INF/portlet.xml file, and is used to tie this .portlet file to the particular portlet in portlet.xml that you want to extend.
    The "{event.namespace}eventLocalPart" is the fully-qualified JSR286 event name, expressed in Java QName notation (with the namespace in {}, followed by the local part).
    The "activatePage" XML tag is used to tell WLP that when this portlet receives this event, automatically make the page that the (receiving) portlet is on the visible page. You don't have to have any code in the portlet to even handle this event-- any time it is sent, the page the portlet is on will automatically be made visible.
    Kevin

  • Wrong image resolution for TIF file

    Under OSX 10.6.2, the image resolution using Preview application is wrong for FAX MultiPages TIFF files.
    If I open up a file with this resolution:
    Image size: 1728 x 1081 pixels
    Image DPI: 204 x 98 pixels/inch
    Color Model: Gray.
    The image always show up all squeezed vertically which tells me the Preview application is not processing the DPI properly. When using the size menu from tools, it assumes the resolution is the same for vertical and horizontal which is wrong.
    I'm unable to use the Preview application to read FAX TIFF files with the standard FAX resolution.
    How do I open up a trouble ticket with Apple developers to fix this issue? I believe it's a software design issue assuming that all TIFF files use the same resolution for both horizontal and vertical DPI. The Preview application should be able to handle different DPI for horizontal and vertical resolution.
    We're a small business and we are running the whole office with Mac Minis and iMac with a Mac Mini Server of course. We love it, but we have this annoying bug which I don't have any way to fix it.
    Thank you,
    Stephan Monette
    Unlimitel Inc.

    Here's a sample of the tif file from our fax machine you can download:
    http://www.hmnet.net/warp2/fax-standard.tif
    Download the file on your desktop and try opening it. You will see the square at the bottom will look like a rectangle. With the right resolution, it should look like a square, not a rectangle.
    If I open the file with Windows picture and fax viewer, the resolution is fine and the square looks like a square. But the same file on Windows with Quicktime fails to open and it complains about a corrupted file.
    On my MAC, the file opens with Preview, but the resolution is wrong.
    Maybe the FAX server is not formatting the TIFF file properly, but we can't fix that since there's no more support for it. But the Windows app is able to open it up with the right resolution. So maybe it's just some code change to do in the Preview app.
    Thanks,
    Stephan Monette
    Unlimitel Inc.

  • JPEG image resolution conversion

    HI,
    Is is possible to change jpeg image resolution using awt or some other way ?
    Thanx

    Im not sure about using awt if you can do it but look up the API's java.awt.*
    There are programs out there that change JPEG resolution though.

  • Setting Resolution in Image Ready

    Is there a way to change the resolution in image ready when you use "save optimized"? I have an image in Photoshop that is 96 dpi and I want to keep that resolution, but it's automatically changing it to 72 dpi. I have CS2.
    Thank you in advance!

    As the other posts suggest, just focus on width x height measured in pixels.
    Image resolution is irrelevant for web images.

  • How do I increase image resolution?

    Not sure what the reason is but when I add photos to a group chat they're the size of the average stamp making the subject of the photo completely unreadable. Is there any way to increase this?
    Bandwidth is definitely not an issue for me or anyone involved in the group chat.

    Hi,
    You may change the Resolution using the HP Scan application as following:
    Click HP Scan at the top and then click Preferences.
    Within the launched windows select the required Resolution.
    close the Preferences window and perform the scan.
    Regards,
    Shlomi
    Say thanks by clicking the Kudos thumb up in the post.
    If my post resolve your problem please mark it as an Accepted Solution

  • Capturing data changes in alv using classes

    Hello All,
    Currently am working on alv report using classes..,In this report am displaying 3 grids in the output in 3 different containers(cl_gui_custom_container)...,Am able to handle the data changes done in the grid  at the run time using event  data_changed ...,
    Now the requirement + problem is ...if i do the changes in all the grids ,,,,,and if i click(hotspot event) on any of the rows/records in any of the grids ...,, I need to be able to capture all the data changes done in all the other grids....,,
    for example:-
    if i modify some records in all the 3 grids ,,, and if I click any of the row in any of the grid at a time,,, all the changes done in all the grids should be captured.....( in simple words one click all changes )
    I tried using data_changed event....., am only able to capture the changes of the grid on which i clicked ( ie.hotspot event) but not the changes which i have done on other grids.....Pls. help me out with the possibilities
    Hope am clear..
    Thanks
    John

    Hi friend,
    METHOD handle_user_command.
      CASE e_ucomm.
    WHEN 'UPDATE'.
                 CALL METHOD r_grid->get_selected_rows
              IMPORTING
                 ET_INDEX_ROWS =
                 et_row_no     = it_rows.
    LOOP AT it_rows INTO wa_rows.
    *****modify the first container data***********
    endloop.
    CALL METHOD r_grid1->get_selected_rows
              IMPORTING
                 ET_INDEX_ROWS =
                 et_row_no     = it_rows1.
    LOOP AT it_rows1 INTO wa_rows1.
    *****modify the second container data***********
    endloop.
    CALL METHOD r_grid1->get_selected_rows
              IMPORTING
                 ET_INDEX_ROWS =
                 et_row_no     = it_rows2.
    LOOP AT it_rows2 INTO wa_rows2.
    *****modify the third container data***********
    endloop.
    endcase.
    Now we can create three container and three different grid class object but we are using same method.
    UPDATE buttton is common to all three containers.
    But one important point when u change the records in container we must select the rows then only selected rows r come to the internal table otherwise it is not come.
    CREATE OBJECT r_container
        EXPORTING
          container_name              = 'CONTAINER_1'
    CREATE OBJECT r_container2
        EXPORTING
          container_name              = 'CONTAINER_2'
    CREATE OBJECT r_container3
        EXPORTING
          container_name              = 'CONTAINER_3'
    CREATE OBJECT r_grid
        EXPORTING
          i_parent          = r_container
    CREATE OBJECT r_grid1
        EXPORTING
          i_parent          = r_container2
    CREATE OBJECT r_grid2
        EXPORTING
          i_parent          = r_container3
    NOW WE CAN CALL THE METHOD.
    CREATE OBJECT event_receiver1.
      SET HANDLER event_receiver1->handle_before_user_command FOR r_grid.
    CREATE OBJECT event_receiver1.
      SET HANDLER event_receiver1->handle_before_user_command FOR r_grid2.
    CREATE OBJECT event_receiver1.
      SET HANDLER event_receiver1->handle_before_user_command FOR r_grid3
    I thing it should be possible.But u must remeber u must select the records when u modifie in three containersBUT UPDATE button is common to all three containers.
    Regards,
    MURALII

  • Changing resolution and image size doesn't change result on screen?

    I'm using Photoshop CS3. I am trying to change the resolution of several images that will be printed in a newspaper. So the current images are 72 ppi and really huge -- for example 36 x 27 inches (document size), and when I change them to 300 ppi, the image sizes shrink to about 8 x 6 inches, as I expect. But the image I see on the screen doesn't change. So, for example, when I open up the image originally, it's at 33% and the entire image is visible. After I change the resolution, and the image size has changed accordingly, the image still appears the same and it remains at 33%. Shouldn't the image shrink on the screen since its size has shrunk? Or if it remains the same on the screen, shouldn't the percentage shift? I mean if the document size is now 8 x 6, it should be able to be displayed at 100% and not fill my whole screen... I'm so confused. Thanks...

    gradded,
    The "Document Size" area of the Image Size dialog is just to indicate the size (in inches) that your document will be printed. The ppi adjustment has nothing to do with what is displayed on your monitor. Your monitor doesn't care anything about ppi. The monitor contains a certain number of pixels and after you change that ppi setting, the monitor will still have that same number of pixels.
    As long as you leave the "Resample Image" box unchecked, your image size (Pixel Dimensions) will not change. You will see no change on your monitor. If you check the "Resample Image" box, then your image size (in pixels) will change.
    Hope this helps.

  • Photos Export Options to Change Image Resolution

    iPhoto used to let you export photos and change the resolution (setting pixel size, for example).  This is a function I used a lot to help my wife who is an artist  who needs to export images to post on eBay with the optimum image size.
    I signed up for the Photos Beta to make sure this function was going to be available.  My recollection is that the first Beta version did have this feature in Photos.  I didn't check the later betas, but now that the production V1.0 is out, I discovered that this feature is not available.
    Does anyone remember seeing this feature in the original beta software?  I was pretty sure it was present, but I might be mistaken.  It seems strange to remove features in the beta process.
    Now I have to use Lightroom to do this.  LR handles this function easily, but it is a lot more complicated.
    David

    I am still seeing the option to change the resolution in the "File > Export > Version" panel.
    Have you searched all options, David?  I have to click the little disclosure arrow tin the Export panel to get to the "custom" option.

  • Swapping Macs, can't change the image file used for TM to a Time Capsule

    Hello ~
    I have ten Macs connected to one TimeCapsule (TC) and nine of them work flawlessly performing a TimeMachine (TM) backup. On the one that doesn't work properly, it is a PBP with Leopard 10.5.8, and latest updates. The other Macs are mixed 10.5.x and 10.6.x.
    I had a user on the PBP that I had been backing up in the past. I erased the HD and reinstalled the OS, and then created a new account. I wanted to start backing up the new account and have the name of the backup be the new name I put under Sharing Preference (I assume that's where TM gets the name of the backup).
    Well, apparently not, the name of the backup is still the old user name from Sharing, and on the old account before the computer was erased.
    I have repaired permissions, I have thrown out the TM prefs in Mac HD\Library\Preferences\, I have restarted the computer. So far I can not get the name to change on the sparse image that it copies to, even though TM says the backup completed without error.
    So, as it appears the backup is using the same old image file that this Mac had been using, the backup are separate when you go into TimeMachine, they do not seem to access each other's data, and inspecting the contents of the image, the date of the backup file is there for the new user in the old image file.
    I really would just like the PBP to stop using the old image file and create it's own image.
    Any ideas welcome!
    Thanks all
    Chaz

    I'm slightly confused. What is a PBP or did you mean a MacBook Pro (MBP)? And, what do you mean by a backup "image?" TM does not make images. Are you actually referring to the backup folder for this machine?
    If I understand correctly what you need to do is delete the old backup for this machine so TM can start from scratch with a new backup. To do that open the TM application and select your backup, then from the Finder's tool icon in the toolbar select "Delete." which should delete the entire backup.
    Also, see User Tips for Time Machine for help with TM problems. Also you can select Mac Help from the Finder's Help menu and search for "time machine" to locate articles on how to use TM. See also Mac 101- Time Machine.

  • How do I change the resolution of a batch of images?

    I have a folder of images that I want to print.
    Resolution is set at 70ppi and I want to change them all to 300ppi.

    PPI is pixels per inch of the image.  It is difficult to increase resolution as you are trying to add data that is not there.
    But for printing purposes what you want is dpi or dots per inch.
    The image processor either accessed from Bridge (tools/photoshp) or PS is a good way to change a batch of images.

Maybe you are looking for

  • External Hard Drive Installation to Extend DVR capacity

    I recently purchased one of the recommended Western Digital 1TB SATA hard drives to extend our DVR capacity.  When trying to install it, the DVR wouldn't recognize the drive.  I worked through diagnostic steps with the Verizon Tech.  Ultimately, they

  • All Quicktime videos are now not displaying video

    Up until yesterday, all of my quicktime files and movies that i could view in itunes, including trailers in the intunes store were working fine. Now for some reason, the audio in any of the above mentioned files works, but the video is now random fuz

  • How to use Structures of Variant Configuratin in BAPI_QUOTATION_CREATEFROM2

    Can any one help me by telling How to use Structures of Variant Configuratin in BAPI_QUOTATION_CREATEFROM2 the structures are :QUOTATION_CFGS_REF, QUOTATION_CFGS_INST, QUOTATION_CFGS_PART_OF, QUOTATION_CFGS_VALUE. What the necessary parameters to be

  • Creating unsubscribe page in spaces application

    Hi , In our application we are using spaces with custom task flow .We having some notification to send every time for some action.I have to create a new page , on which user can enter email id and click unsubscribe . This page should open from the li

  • Does GPS on iphone work witout a cell tower...

    I am currently in india and iphone is unable to locate me on Google maps. Is this okay? I thought iPhones uses any one or a combination of GPS/Cell Towers/WiFi hotspots to locate itself.