• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 513
  • Last Modified:

Auto Reduce file pixel size from Excel?

See attached spreadsheet.  I have an old file name, column E, and a new file name in Column D, that when run it changes all the filenames in that directory/folder to whatever is in column D.  This is to rename file to more of a consistent naming convention.

My question, has to do with PhotoShop because each of these new filenames are going to be ,pdf files and have a specific pixels size.  What I was wondering if we can do is, with code, script a macro or something that would open each file in column D, starting in row two, open the file, set a new pixel size, (same for all files), then resave it to the same folder path and filename.  Going down the list until all .pdf files have been chg'ed.

I would like an input box to declare the new size that would be applied to all files.

Have you ever heard this done and can this be automated to edit each file in column D?  Lets just say that there are so many files that it would take me weeks to do these manually.

I need to know some specifics too, I do not have PhotoShop, but I do have SnagIt.  Can this run in Excel and have Excel access PhotoShop (when I get it).  Just wondering what my options are to automating such a task, and if PhotoShop can do this? or do I need to look at possibly a different solution to do this task.

Please advise and thanks. -R-
PDF.xlsm
0
RWayneH
Asked:
RWayneH
  • 8
  • 5
  • 2
  • +1
1 Solution
 
Sigurdur ArmannssonDesigner Commented:
I am afraid I don't have the knowledge to fiddle with macros between Excel and Photoshop and therefore I would myself do it like this and maybe that is a solution for you too.

A. Get Photoshop. The trial works for 30 days and with a little help it might just work for you.

B. Get: IMAGE PROCESSOR PRO from http://www.russellbrown.com/scripts.html, easy install.

C. Get into how this works, take a look at Dr. Russells intorduction video to see how this is used.

D. Let Photoshop slave.

It seems to me from what you write and from that Excel file that you want to change resolution / size of pictures and rename them so this just might be the ready made tool for you.

I have used it a lot, mostly when I need to convert many pictures for web use. If the renaming feature is not good enough for you there are plenty of cheep or free tools out there.
0
 
David BruggeCommented:
Image Processor Pro will do everything for you but fetch the images automatically. For this, you will need a javascript.

Unfortunately, we don't write scripts here, we just tell you how. In the past, we didn't have any Experts here that were proficient in writing scripts for Photoshop and I don't know if any have joined us lately, so I'm not sure that we can even tell you how.

It's something I always mean to take the time to learn, but never seem to get around to.
0
 
RWayneHAuthor Commented:
Ok.. how would we know if there is anyone that has joined lately that could help us?  There is really only two things that I need.  To change the .jpg to a different size, which it appears the Dr. Brown addin can do and second, return the general color info.  Open the file, return its color number.. or RGB number.. so we can group like colors together.  Maybe tack that onto the file name?  Will the Dr. Brown addin do both of these?  Interested in your comments on the second task that we want to perform on each file.  Not so sure we can do this without opening all 20K files and doing this manually... which will take weeks.

Perhaps we need to send this question to the javascript and/or someone in the Excel area?  See if anyone has done something like this before?  I opened this in the PhotoShop area and am not sure how to open this up to those other two areas..  if you could assist in that.. I am sure that I am not the only one that has ever had to do some of these tasks on large volume of files...

Any additional information appreciated.  Thanks. -R-
0
Cloud Class® Course: CompTIA Cloud+

The CompTIA Cloud+ Basic training course will teach you about cloud concepts and models, data storage, networking, and network infrastructure.

 
Sigurdur ArmannssonDesigner Commented:
When you talk about "general color info", do you mean like Red, Yellow etc.,?
Are these pictures that when you look at it you could say: Yes, this one should be in the Blue area?

Or are you thinking of picking up some meta data out of the picture?
0
 
RWayneHAuthor Commented:
Pictures would return a..  yes this one should be in the Blue area, based on the RGB color number that it would result in...  that one is red this one is purple .....    Basically to group the 20,000 images color categories...  I also post a question on the Excel VBA board to see if anyone has used VBA to open a file, in a different program, change it and grab data on it, and feed it back to Excel?  Worth an ask...  You can tell I am trying to get away from having to handle all these files one at a time...  Thanks.   -R-
0
 
Sigurdur ArmannssonDesigner Commented:
I have just one more question:

Are the pictures just flat colors?

If so, there should be a way to have Photoshop to dip the Eyedropper tool into that color and have another action pick up the color blend numbers.
0
 
RWayneHAuthor Commented:
Yes most are flat colors...  so this would be a Dr. Brown add-in right?  Add it as an action and append it to the filename?  I do not have the addin, is that one of the options of the addin? and a possible solution?  Sounds like it is, provided it is one of the actions to choose from.  -R-
0
 
Sigurdur ArmannssonDesigner Commented:
DrBrown script only deals with size, resolution and filetype. Renaming too, but only basic, series, prefixes etc. But it also allows other actions to be run in context before it runs.
0
 
David BruggeCommented:
@ sigurarm

I was wondering, when the file goes into Photoshop, crating a composite layer, averaging the colors and then discarding the layer?

I haven't worked enough with PS scripting and its metadata to know where you could store the number, but I seems workable.
0
 
Sigurdur ArmannssonDesigner Commented:
I am not into scripting but from javascripts I have seen it would be most likely possible to make a script that would gather the RGB or CMYK values into a container and then move the info to where it could be used as a part of a name.

It might be worth the try to place this question over at the Adobe forums for Photoshop scripting. http://forums.adobe.com/community/photoshop/photoshop_scripting

The people there are very helpful.
0
 
Dan CraciunIT ConsultantCommented:
I do think you can accomplish this using AutoIt and the IrfanView or a similar simple file processing software.
Basically, AutoIt allows you to automatize any repeating task that you can do using your mouse and keyboard. So if you can do it manually for your 20k images, you can do it using AutoIT.

As for getting a color, it has a function called "PixelGetColor (xpos, ypos)" that will return the color from a specified position in hex format.

A quick algorithm will be something like:

for every file in <image_folder>
  open it with IrfanView
  resize it
  get pixel color
  new_name = old_name + color + resized.jpg
  save file as new_name

If you haven't solved the problem yet I can probably write the script for AutoIT.

HTH,
Dan
0
 
RWayneHAuthor Commented:
I have not solved this yet and a script to do this would be great.  Do I need to buy a copy of IrfanView? or is it freely available?  Are the task carried out in Photoshop or does the IrfanView do these outside of the PhotoShop enviorment?  I am not familar with PhotoShop either and was hoping that someone has done this before.  -R-
0
 
Dan CraciunIT ConsultantCommented:
OK. Let's take it one step at a time.
Please answer the following questions:
1. Do all your files reside in one folder?
2. Are they all the same format? Jpeg?
3. Do you want to re-size them all to the same size?
4. Do you need to convert them to another format?

Dan
0
 
RWayneHAuthor Commented:
Q1 = yes, Q2 = yes, Q3 = yes and Q4 = No   However in Q3, I would like to dictate the size prior to executing..  -R-
0
 
RWayneHAuthor Commented:
Figured this out.. Thanks -R-
0
 
RWayneHAuthor Commented:
I've requested that this question be closed as follows:

Accepted answer: 0 points for RWayneH's comment #a39731414

for the following reason:

Got another solution to issue. -R-
0
 
RWayneHAuthor Commented:
This worked pretty good.  Thanks. -R
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Microsoft Windows 7 Basic

This introductory course to Windows 7 environment will teach you about working with the Windows operating system. You will learn about basic functions including start menu; the desktop; managing files, folders, and libraries.

  • 8
  • 5
  • 2
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now