Solved

Auto Reduce file pixel size from Excel?

Posted on 2013-10-22
17
486 Views
Last Modified: 2013-12-22
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
Comment
Question by:RWayneH
  • 8
  • 5
  • 2
  • +1
17 Comments
 
LVL 22

Accepted Solution

by:
Sigurdur Armannsson earned 500 total points
ID: 39592316
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
 
LVL 26

Expert Comment

by:David Brugge
ID: 39592385
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
 

Author Comment

by:RWayneH
ID: 39594172
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
 
LVL 22

Expert Comment

by:Sigurdur Armannsson
ID: 39594274
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
 

Author Comment

by:RWayneH
ID: 39594314
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
 
LVL 22

Expert Comment

by:Sigurdur Armannsson
ID: 39594429
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
 

Author Comment

by:RWayneH
ID: 39594612
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
 
LVL 22

Expert Comment

by:Sigurdur Armannsson
ID: 39595062
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
Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

 
LVL 26

Expert Comment

by:David Brugge
ID: 39595330
@ 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
 
LVL 22

Expert Comment

by:Sigurdur Armannsson
ID: 39595719
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
 
LVL 34

Expert Comment

by:Dan Craciun
ID: 39619607
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
 

Author Comment

by:RWayneH
ID: 39621890
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
 
LVL 34

Expert Comment

by:Dan Craciun
ID: 39621946
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
 

Author Comment

by:RWayneH
ID: 39624234
Q1 = yes, Q2 = yes, Q3 = yes and Q4 = No   However in Q3, I would like to dictate the size prior to executing..  -R-
0
 

Author Comment

by:RWayneH
ID: 39731414
Figured this out.. Thanks -R-
0
 

Author Comment

by:RWayneH
ID: 39734819
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
 

Author Closing Comment

by:RWayneH
ID: 39734820
This worked pretty good.  Thanks. -R
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Lync meeting or Lync conferencing is what many organizations would like to deploy to allow them save money. But companies are now giving up for various reasons, one of which is that they cannot join external meetings (non-federated company meetings)…
The new Microsoft OS looks great, is easier than ever to upgrade to, it is even free.  So what's the catch?  If you don't change the privacy settings, Microsoft will, in accordance with the (EULA) you clicked okay to without reading, collect all the…
Make a selection using the pen tool to trace the selection. Then alter the color of the selection by using the color balance option in Adobe Photoshop.
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now