Image conversion applescript
I am not proficient in Applescript (yet) and I was wondering if anyone out there has any script that I could apply to a folder action for converting photos to 720x480. I have a user that needs a few hundred photos converted and it would be nice to not have to do them one at a time.
See this topic: {thread:id=1518066}.
It is mentioned (and largely ignored by the OP) that you have to specify which kind of precision loss you're ready to bear. There is a code example that scales color levels to reduce the number of bits (sounds like exactly what you're looking for).
Similar Messages
-
Hi
I need image conversion to run in Forms6.0
I have a global360 Imaging, and I having a tough time, trying to convert the image from one type of compression to another.
The global360 has given sample code for VB. I tried to follow the step by step process in forms but it does not seem to work. Below I have pasted the code, there must be some glitch which I do not seem to find......
Can anybody help?
DEFAULT_VALUE('***', 'GLOBAL.PAGECOUNT');
DECLARE
scan_ole oleobj;
edit_ole oleobj;
file_ole oleobj;
dummy NUMBER;
lst ole2.list_type;
scancomplete BOOLEAN;
a NUMBER;
b VARCHAR2 (2000);
v_error VARCHAR2 (50);
scanerror EXCEPTION;
PRAGMA EXCEPTION_INIT (scanerror, -20010);
BEGIN
forms_ole.ACTIVATE_SERVER ('ocx');
scan_ole := forms_ole.GET_INTERFACE_POINTER ('OCX');
IF imaging_dimgscan.scanneravailable (scan_ole) <> 0
THEN
dummy := imaging_dimgscan.startscan (scan_ole);
--Imaging_DImgAdmin.CompressionType(scan_ole, AdminLibCtl_CONSTANTS.CompTypeGroup32DFax);
/*imaging_dimgscan.compressiontype
(scan_ole,
scanlibctl_constants.CCITTGroup4_2d_Fax
scancomplete := TRUE;
ELSE
scancomplete := FALSE;
v_error := 'Scanner not available';
RAISE scanerror;
END IF;
IF scancomplete
THEN
forms_ole.ACTIVATE_SERVER ('EDIT');
edit_ole := forms_ole.GET_INTERFACE_POINTER ('EDIT');
/*imaging_dimgscan.compressiontype
(edit_ole,
scanlibctl_constants.CCITTGroup4_2d_Fax
--b := imaging_dimgedit.ShowPageProperties(edit_ole);
b := imaging_dimgscan.destimagecontrol (edit_ole);
imaging_dimgscan.destimagecontrol (edit_ole, b);
a := imaging_dimgscan.closescanner (scan_ole);
GO_BLOCK ('SCANNED_IMAGES');
:SYSTEM.message_level := 25;
forms_ole.ACTIVATE_SERVER ('FILE');
FILE_ole := forms_ole.GET_INTERFACE_POINTER ('FILE');
-- Imaging_DImgAdmin.Image(file_ole,'C:\SCAN0001.TIF');
--:di := IMAGING_DIMGADMIN.Image(file_ole);
-- IMAGING_DIMGEDIT.Image(edit_ole, IMAGING_DIMGADMIN.Image(file_ole));
-- IMAGING_DIMGEDIT.CompressionType(edit_ole, );
--IMAGING_DIMGEDIT.Display(edit_ole);
--What parameter to pass ???
--b:= Imaging_DImgedit.ShowPageProperties(edit_ole,0);
IMAGING_DIMGEDIT.SaveAs( edit_ole, 'C:\SCAN0001.TIF');
READ_IMAGE_FILE ('C:\scan0001.tif', 'ANY', 'SCANNED_IMAGES.IMAGE_DATA');
IF NOT FORM_SUCCESS
THEN
v_error := ' Could not read image file';
:SYSTEM.message_level := 0;
RETURN;
END IF;
:SYSTEM.message_level := 0;
IF :scanned_documents.zoom_amount IS NOT NULL
THEN
IMAGE_ZOOM ('SCANNED_IMAGES.image_data',
zoom_percent,
:scanned_documents.zoom_amount
END IF;
:scanned_images.page_count := TO_NUMBER (:GLOBAL.pagecount);
:scanned_images.description := 1;
:scanned_images.page_number := 1;
END IF;
EXCEPTION
WHEN scanerror
THEN
a := imaging_dimgscan.closescanner (scan_ole);
MESSAGE (v_error || ' ' || SQLCODE || ' ' || SQLERRM);
WHEN OTHERS
THEN
a := imaging_dimgscan.closescanner (scan_ole);
MESSAGE (v_error || ' ' || SQLCODE || ' ' || SQLERRM);
END;hii jlaundry
I dont know what if You would like my suggestion...
try to divide ur job into 2 part..
i mean in photoshop its so easy 2 make a little action can convert all ur files to Jpegs & rescalling them
then upload them to ftp with different script..
byee -
Hi all
I wonder how these image conversion happens when it comes in the point of converting multiple image in to a single TIFF..i am doing it to the extent resulting in the image creation with file size..The Mystery is i dont have any image when i open the TIFF image...can some one guide me how to handle things...Hi,
thanks for reply.
But changing in SPRO -> is just the display option.
But the issue that is being faced is with the currency conversion in the query. since the rate for that currecny maintained in tcurr table is a very small value, the conversion is not happening and its displayed as it is in the query output.
also, we cannot go with the option of changing the ratio in tcurr table for this currency, because there are so many dependent objects and then we have to change some logic for all those to incorporate this rates. and our Basis team has mentioned that changing the ratio will not be done because of this.
how do i go about? whether any other methods available? -
We are trying to find or create a solution for converting any of a set of Adobe files (PSD, AI, PDF, INDD) into JPEG files for each page. Doing it through an API would be preferred, but at this point we are happy to have any starting point to work from.
There is an article on the Developer Network website:
Adobe Creative Suite image conversion utility
http://www.adobe.com/devnet/creativesuite/articles/image-conversion-tool.html
I am trying to find out where to download this tool. How do I get it?
Also, does anyone else have suggestions on how to go about this? I haven't found a way to actually talk to anyone at Adobe support yet, even with a paid Creative Cloud subscription.
Thanks!Extension Manager team knows nothing about it. Maybe http://forums.adobe.com/community/creativesuites/cs_sdk is a better place for this question.
-
Can iPhoto 4.x do batch image conversion of JPGs to TIFFs, and vice versa?
Is there freeware for Apple Macs that can do this? Photoshop is too rich for my blood.
Thanks.Unfortunately, you have posted to the Photoshopn (PsE's big-brother) General Discussions Forum. There is a very good, and active Ps Elements Forum, where your question will be answered. I will Move your thread to the Ps Elements Forum, and your link, plus any e-mail subscriptions will follow.
Good luck,
Hunt
[Moved to Photoshop Elements Forum] -
Image conversion failed adding profile picture
I just finished my first test install of a Basic Teaming 2.0 site on SLES 11 64bits with SUN's JDK v. 1.6.0_17 and MySql 5.1.39, which went ok. However, when I login and try to add a picture to a profile an X-like image is diplayed instead and I get the following error in the ssf.log file:
WARN [http-8080-2] [com.novell.teaming.docconverter.impl.ImageStellent Converter] - Image conversion failed for testpic.gif: (127) Can't find resource for bundle com.outsideinsdk.ExportResources, key 127
I have not been able to find any info about this in the Doc or forums.
Any ideas?
Thanks in advanceI got your email and as you suspected, your image works fine on a system
that does work.
You mention a "conversion failure". What kind of visual indication are
you getting of that failure? Is anything at all getting posted to the
catalina.out log?
MacWiz.
On 12/18/09 12:07 PM, MacWiz wrote:
> In looking through the code, any conversion errors or exceptions should
> be going out to the catalina.out file by default. There's no other
> tracing available in this area.
>
> Can you email me the image that you're using to [email protected]?
>
>
> MacWiz.
>
>
> On 12/18/09 11:46 AM, ad1az wrote:
>>
>> Right, it's loading and yes, validated the path. Basically, no errors
>> after the "conversion failure" msg (I do get a complain about not being
>> able to access my smtp server, but I think that's unrelated). Is there a
>> way to enable more detailed logging to see if there's any other clues?
>>
>> One thing I just noticed is that I don't get the conversion failure
>> error unless I move to the Profile tab. For example, If I am in the
>> Overview tab when I click "modify profile" and add a profile picture, I
>> don't get the error at that moment. I only get the error once I move to
>> the profile tab.
>>
>>
>> drfoster;1907114 Wrote:
>>> When you run the exporter executable from a command line now, it simply
>>> gives you errors about missing parameters or something, right? If so,
>>> that means it's loading and the library linkage is correct.
>>>
>>> And you've validated your GDFONTPATH, correct? Casing and all? I've
>>> seen situations where users have setup symbolic links to the correct
>>> location from the default location and missed the casing on X11. One
>>> of
>>> the path nodes in the default path is X11 (note the capital X.)
>>>
>>> Any errors after the conversion failure in the catalina.out log file?
>>>
>>>
>>> MacWiz.
>>>
>>>
>>> On 12/17/09 4:46 PM, ad1az wrote:
>>>>
>>>> MacWiz,
>>>>
>>>> thx for your answer!
>>>>
>>>> I'm back to work on this and I saw your response to another post
>>>> regarding the fonts and I it helped me uncover an issue with the c++
>>>> library. I installed the correct library and was able to run the
>>>> 'explorer' script without complains, but I still get the same error.
>>>> Any other pointers?
>>>>
>>>>
>>
>> -
Controlling Image Conversion quality from Word to RoboHelp 8
I cannot find settings that will control image quality when converting Word documents to online help files by means of RoboHelp.
My problem is that screen captures, which were inserted as PNG or bitmaps, are reproduced with what looks like GIF or JPEG quality in the online help. I want better quality.
I read that for Famemaker, there are image conversion settings that enable one to preserve full, lossless (screen) resolution during the conversion.
Is there a way to do this for conversion from Word 2007 documents to RoboHelp 8?
If not, perhaps RoboHelp 9?
Much obliged.I am importing the Word documents into RoboHelp HTML version 7.0. I did the following experiment:
I imported a document with images containing vector text (the images are in Microsoft Office Object format) from Word 2007 to RoboHelp HTML 7.0, I got poor quality (badly formed text / aliasing). I presume this comes from the rendering and compression performed by the import function. I also saw JPEG artifacts in the raster (screen captures) images of the kind visible at very high compression ratios and which were not visible in the original.
When I insert the very same images, saved as PNG format at screen resolution, directly into RoboHelp HTML 7.0, I get good quality.
It seems that the Import from Word function is rendering and converting the images to a compressed format without preserving sufficient quality.
My questions are:
Is there a preferred format for the embedded images in Word for better import to RoboHelp, especially when the images contain (vector) text?
Are there accessible configuration parameters for the Import from Word function, that can control the rendering, and/or the quality level of JPEG compression, and/or give a choice between compressed and uncompressed images.
How can I access those parameters?
Thanks! -
Adobe Creative Suite image conversion utility, or similar?
We are trying to find or create a solution for converting any of a set of Adobe files (PSD, AI, PDF, INDD) into JPEG files for each page. Doing it through an API would be preferred, but at this point we are happy to have any starting point to work from.
There is an article on the Developer Network website:
Adobe Creative Suite image conversion utility
http://www.adobe.com/devnet/creativesuite/articles/image-conversion-to ol.html
I am trying to find out where to download this tool. How do I get it?
Also, does anyone else have suggestions on how to go about this? I haven't found a way to actually talk to anyone at Adobe support yet, even with a paid Creative Cloud subscription.
Thanks!Extension Manager team knows nothing about it. Maybe http://forums.adobe.com/community/creativesuites/cs_sdk is a better place for this question.
-
Is there a way to edit IPTC data of an image with AppleScript?
Hi,
I'm looking for a way to batch-edit the IPTC data from images. Is that somehow possible with Applescript? If so, could someone point me to a direction?
(I fond a script working wit Graphic Converter in another thread, but that didn't work.)
Thanks,
p.Frank, maybe you could give me a hand here. I'm building the basic script cycling through the dropped files. But I don't know how to best implement the terminal command.
In each cycle, I would set the file path as a variable and then compose the terminal command in order to execute it with "do script".
But "set x to path of eachFile" doesn't work: <<class ppth>> of alias "(path shows here)" could not be read. Any ideas how to do that better?
on open theFiles
repeat with eachFile in theFiles
set x to path of eachFile
tell application "Terminal"
activate
do script "hello" (Exiftool command will be here)
close window 1
end tell
end repeat
end open -
1.Is there any efficient way of exporting or converting a Pages file to an image file e.g. .jpg? Has anyone built a patch for this or can a script be used. It's very frustrating as we used to use the AW Suite for this conversion. A number of people have suggested we use print to pdf and then use Image Preview as the converter, but it will not convert a multi page file (will only convert 1 page @ a time) this is very tedious and requires too many steps. Does anyone know a quick way of doing this?
2. Is there any efficient way of upgrading AW Draw files as AW is being phased out?Russell Burt wrote:
1.Is there any efficient way of exporting or converting a Pages file to an image file e.g. .jpg? Has anyone built a patch for this or can a script be used. It's very frustrating as we used to use the AW Suite for this conversion. A number of people have suggested we use print to pdf and then use Image Preview as the converter, but it will not convert a multi page file (will only convert 1 page @ a time) this is very tedious and requires too many steps. Does anyone know a quick way of doing this?
I will try to write a script printing a document in several onepagepdf.
2. Is there any efficient way of upgrading AW Draw files as AW is being phased out?
If your Draw documents doesn't contai tables or spreadsheets, you may look at EasyDraw.
As I often wrote, Numbers is a perfect tool to import AW Draw documents.
I hope that Apple will write the needed importer tool.
If they don't, I wiil write a script to do that when Numbers will be scriptable.
Yvan KOENIG (from FRANCE mardi 29 janvier 2008 10:01:49) -
Read metadata of placed image (CS4-Applescript)
Is it possible to read the metadata (description field, ...) of a placed image using CS4 & Applescript, and what is the syntax?
Thanks,
PeterHello all,
It looks like it has been a while since this thread was active, however I thought I'd give it a shot.
I'm trying to do the same thing as the OP. But specifically I'm trying to capture the InstanceID from the Media Management Schema.
xmlns:xmpMM="http://ns.adobe.com/xap/1.0/mm/"
xmlns:stEvt="http://ns.adobe.com/xap/1.0/sType/ResourceEvent#">
<xmpMM:OriginalDocumentID>xmp.did:2C9BA0F20F2068118B12C50AA55392B0</xmpMM:OriginalDocumen tID>
<xmpMM:DocumentID>xmp.did:2C9BA0F20F2068118B12C50AA55392B0</xmpMM:DocumentID>
<xmpMM:InstanceID>xmp.iid:E324D45D2A2068118F62CC41CFB88906</xmpMM:InstanceID>
<xmpMM:PreservedFileName>TKTKTKTK.dng</xmpMM:PreservedFileName>
I'm using Indesign CS5, and looking in the AppleScript Dictionary, I see:
get property v : Gets the XMP property value associated with the specified path.
get property link metadata
namespace text : The namespace of the property.
path text : The specified path.
→ text : The associated property value.
But, I can't work out the syntax. Any help would be appreciated.
My end goal is to harvest the Instance IDs and then form them into a search query for a DAM.
Many thanks.
-Andrew Mannone
EDIT: I figured out the syntax:
tell application "Adobe InDesign CS5"
tell document 1
tell links
set linkInstanceIDList to get property link xmp namespace "http://ns.adobe.com/xap/1.0/mm/" path "InstanceID"
end tell
end tell
end tell
Message was edited by: Andrew Mannone -
Anybody know how to go about converting a swing container (such as JFrame) into an image like JPEG or PNG? Also, is there any library to allow conversion into PDF?
Thanks,
Mehul.Ohh yeah..that's amazing.
Another issue:
I'm using a 3rd party charting software in which they have a Chart class that extends from JLayeredPane. Now this Chart component has other subcomponents like Legend and ChartArea. The Legend and ChartArea classes extend from JComponent. The ChartArea includes 2 things: a drawing rectangle and a plotting rectangle. The plotting rectangle is a part of the drawing rectangle. The drawing rectangle also includes other stuff such as the axes, some margins/boundaries etc.
Now, what I am trying to do is to provide the ability for a user to select a portion of the drawing rectangle by dragging his mouse. To do this, I create a chart class extends from Chart and then provide a paintComponent method in which I adjust my coordinates so that they are for the ChartArea rather than Chart. But, here's the problem I'm seeing: Without calling setXOR in paintComponent, when I drag my mouse on the ChartArea, my selection box is visible only outside the plotting rectangle (but still within the drawing rectangle)..the rest of the plotting area also gets selected, but my selection there gets hidden behind the plotting area...so I can't really see what region i've selected. If I do call setXOR, then I can see the entire selection box on top of the plotting rectangle, but my plotting rectangle gets a little disoriented and discolored when I click on it (to do the selection).
I'm not able to understand why I'm seeing this behavior. Any ideas?
Thanks. -
How to control canvas color with preview/automator image conversion
I am using an automator workflow (image attached showing workflow) to scale and pad (change canvas size of) images that I am uploading to a website. However, some images will end up having a black canvas while others will have a white canvas post-conversation. I would like all converted images to have a white canvas. Is there a way to ensure this?
Here's a solution that works:
https://discussions.apple.com/message/8402697#8402697
thanks spazek! -
Assistance with image conversion program.
hello,
I am relatively new to java so have already requested some help within the "new to java" section of the forum but wondered if it might be more appropriate to post my question in here? anyway...
I am trying to write a program which will convert a color image into a greyscale image. I have managed to get my code to compile but the output i receive is not what i expected. When running the conversion it produces a black image. The idea is to create an array, use pixelgrabber to place each pixel into this array, get the red, green, and blue values, convert into greyscale, add these coverted pixels to an array and make a new image from these. My code is below:
class SaveGreyMenuListnr implements ActionListener {
private ImagePanel panel = null;
SaveGreyMenuListnr (ImagePanel pn) {
panel = pn;
public void actionPerformed (ActionEvent ae) {
Image displayed = panel.getDisplayImage();
int width = displayed.getWidth(panel);
int height = displayed.getHeight(panel);
int pixels[] = new int[width*height]
PixelGrabber pg = new PixelGrabber(displayed, 0, height, width, height, pixels, 0, width);
try{
pg.grabPixels();
} catch (InterruptedException e) {
System.err.println("interrupted waiting for pixels");
for (int i = 0; i < (width*height); i++){
Color myColor = new Color(pixels);
int Red = myColor.getRed();
int Green = myColor.getGreen();
int Blue = myColor.getBlue();
double temp = 0.56 * (double)Green + 0.33 *(double) Red + 0.11 *(double) Blue;
myColor = new Color((int)temp,(int)temp,(int)temp);
int compressedInt = myColor.getRGB();
pixels[i] = compressedInt;
Image image = panel.getToolkit().createImage(new MemoryImageSource(width,height,pixels,0,width));
panel.setDisplayImage(image);
panel.repaint();
I think an issue is arising when using the getRed getGreen and getBlue methods... for example If i request System.out.println(Red); then a stream of 0's are shown on the command line.
Not 100% sure if this is the issue or if it is further back in my code. Any help would be greatly appreciated
cheersNope, don't crosspost. Please stay in your [original thread|http://forums.sun.com/thread.jspa?threadID=5350452&messageID=10520330#10520330]. I'm locking this one.
-
Crop Image using applescript?
Hi all
I'm trying to set up a script that will batch crop a bunch of files to 320X320 (album artwork size). However, I have yet to come across a sample/tutorial of how to set up the actual crop commands. Is cropping images even possible with applescript?You're right it does work now!
I've tried to adapt Camelot's code to my version of the script but for some reason, the images don't get cropped.
here is my code so far:
-- global variable declarations
global _widthHeight
global _folderA
global _folderB
global _workFilesInA
global _workFilesInB
global _theImage
set _widthHeight to the text returned of (display dialog "Enter dimension for width and height:" default answer "320")
set _folderA to (choose folder)
tell application "Finder"
set _workFilesInA to every file of folder _folderA
end tell
tell application "Finder" -- creation of temporary folder
if (the folder "path:processedImages" exists) then
set _theAns to the button returned of (display dialog "A folder named processedImages already exists." buttons {"Cancel", "Yes"} default button "Yes")
if _theAns is "Yes" then
tell application "Finder"
delete the folder "path:processedImages"
set _folderB to (make new folder at "path:Desktop:" with properties {name:"processedImages"})
end tell
end if
else
set _folderB to (make new folder at "Path:Desktop:" with properties {name:"processedImages"})
end if
end tell
-- work code
if (count of _workFilesInA) is not 0 then
repeat with i from 1 to count of _workFilesInA
try
tell application "Finder"
duplicate item i of _folderA to _folderB
end tell
on error errmess
display dialog "This error occured: " & errmess
end try
end repeat
end if
tell application "Finder" -- crop files in temporary folder
set _folderB to "Path:processedImages"
set _workFilesInB to every file in folder _folderB
tell application "Image Events"
repeat with i from 1 to count of _workFilesInB
crop item i to dimensions {_widthHeight, _widthHeight} **********
save item i
end repeat
end tell
end tell
everything works up to the **********. The events log tells me that the items were cropped (it even cycles through the), but upon inspecting the images, no cropping is evident.
Maybe you are looking for
-
Scheduling a report in bi publisher
Hi guys, I am new to BIP Can any one help me out in how to schedule a report through email in BI Publisher?? Regards, Sai
-
when bluetooth headset is connected to iphone,I can't hear iphone ringing aloud when I have a call or a text. Do i really have to wear the bluetooth headset all the time in my ear to know when I have a call or a message? Why it doesnt ring through ip
-
Im going crazy. Everytime I click on a sub-menu within a document or email, the pointer takes me back to the beginning of the document. For example, I need to change the colour of my response to a series of questions. I click on red in the drop dow
-
Connect to multiple local instances without enterig passwords
Oracle 10R2 on Linux Gentoo I have several local instances which I want to connect in shell script without setting password explicitly. But when I use @connect_string it seems to me that os authentication is ignoring by oracle. Look at this: oracle@o
-
How to separate execution threads to different CPU core?
I have code that needs to be executed in parallel. The code is not in a loop. One part of the code needs to handle GUI selections while the other part of the code does something else. I want each thread to run in a separate core because the other