Photoshop - I need to batch resize 20 images. I need pngs - png

I have searched and almost found the answer.
File > script > Image processor > Select folder > resize to fit
But, I can't see the option to save as png format (as you can see from my screenshot - using photoshop CC 2017)

You can do this by creating an action and then batch processing:
A. Create the action
Open file in Photoshop
Start recording
File > Save As > set file type to png
Click Save
Stop recording and save your action (Save as png for example)
B. Process your files
Select all your files
Tools > Photoshop > Batch
Select your Save as png action
Click Ok to process

Related

How can I reverse an accidental Gzip compression?

I am using Raspbian and had a folder full of images. I selected all of the images, right clicked them, and selected "Compress" so that I could put them in an archive to move to another computer. I selected archive type as "gz" and left "add archive extension to filename" checked. What was produced was a "[oneofthepicturefilenames].png.gz" which I moved to the other computer.
The problem is, when I open this .gz, I only see one png that is the size of the entire directory I compressed (1.4Gb). unfortunately, the source images were deleted, and I'm trying to figure out how to recover my images from this file as I assume their data is still there in some strange format. Any ideas?
The images aren't sensitive, so if anyone wants to take a look at what I've done, you can see the file here.

Combine contents of selected text files with into 1 text file with Mac Automator and Services

I am trying to combine the contents of selected text files in Finder into 1 text file, using the Services context menu and control-clicking on .txt files.
I have started a new Service Workflow in Automator, added the steps I think should work (see attached workflow file) and saved the file.
https://drive.google.com/file/d/0B7x9CADuUNaQRjhneklJQmNuT2s/view?usp=sharing
The problem is that the Services menu doesn't pop up when I have text files selected in Finder. It pops up when I have PDF files selected in Finder, but that's no help as the output file doesn't work.
Any ideas how to correct it so that it can work with selected text files?
Thanks in advance.
Ryan
Here is the final version. Your trial had chosen the incorrect Action to ignore:

Can't configure background image for DMG installation using CMake

I am working with CMake 2.8.10.2 on Mac OS X 10.7.5.
I've configured CMake to build a simple application with Xcode that creates an empty window. I then tried to configure CMake to build a DMG installation of the program specifying a background image using:
set(CPACK_DMG_BACKGROUND_IMAGE /path/to/image)
and custom .DS_Store to set windows size and icon placement using:
set(CPACK_DMG_DS_STORE /path/to/DS_Store file)
Xcode will successfully build the application and create the disk image. When I mount the image it comes up with the correct size and icon placement, however the background is always set to white instead of specified background image.
What is needed to get the background to display properly in the disk image?
Unfortunately no one has responded this question. This has been a frustrating experience, however, it looks like I finally solved it so I'm posting a description here to save someone else the grief if they ever have to deal with this.
In order for a background to work on an installation image, basically two things must happen; the background file must exist within the installation image, and the .DS_Store at the root of the image must be configured to use that background.
The .DS_Store file can be configured by mounting the install image in a writable state and then selecting Show View Options from the Finder's View menu. From there someone will select the Picture option for the Background and drag the background file to the placeholder in the Show View Options panel.
When working with CPack, the trick is to be able to drag the image. When someone sets the background for the installation, builds, and mounts the image it will not look like there is any background to drag to the Show View Options panel. If someone goes into the Terminal and does
ls -a
on the root of the mounted install, that command will list, among other things, a file called background.png. This file does not display in the Finder.
The reason this file displays in the Terminal and not the Finder is because it has an extended attributes that makes it hidden for the Finder. Since the file is hidden from the Finder it is not possible to drag the file to the Show View Options panel. Doing
ls -l#
will reveal what extended attributes are applied to the file. There should be only one called com.apple.FinderInfo. Removing this attribute should make the file visible in the Finder. The attribute can be removed using this command from the Terminal
xattr -d com.apple.FinderInfo background.png
After removing the attribute the background file still will not show up in the Finder right away. Someone will have to eject and remount the install image. Once this has happened, the background file should appear in the Finder and someone can drag it to the Show View Options panel, which will cause the background image to display in the Finder window for the install image. After that, someone can copy the .DS_Store file from the root of the install image and apply it to the CPACK_DMG_DS_STORE attribute, and the background image should appear whenever an install image is built.
#TronThomas response helped me out dramatically. Not to supplant his answer, here's some additional information about the process that I just worked through. For reference, this is with MacOS Sierra and CMake 3.6.2.
Set a background image with set(CPACK_DMG_BACKGROUND_IMAGE /path/to/image)
Create the DMG file using the CPack generator DragNDrop
Mount the image in read/write mode using a shadow file hdiutil attach mypackage.dmg -shadow junk.dmg
At this point, we don't see a background image, but one exists in the folder .background in the DMG file. Our strategy will be to use Finder to make the window exactly how we want, then copy out the .DS_Store file.
On the Finder menu, click View->Show View Options
Under Background:, click the Picture radio button. Then, click the image above the text Drag Image Here. Note, the current view must be as Icons otherwise this dialog will not be there.
In the file dialog, go back to the mounted DMG image. Then, press cmd-shift-. This should show the hidden folders. From here, go into the .background folder and select the background image.
If everything has worked properly, the background image should now be visible.
Adjust the windows size and view or hide toolbars as desired on the View menu. The exact settings will be replicated by the installer.
Copy off the the hidden .DS_Store file in the root directory of the volume to another location. The cmd-shift-. trick can be used view the file or just use the Terminal at this point to copy everything. Note, we can change the name of this file to DS_Store, so that it's not hidden when we store it.
Eject the DMG file from Finder. Delete junk.dmg or any shadow files remaining.
Back in the CMakeLists.txt, set the variable set(CPACK_DMG_DS_STORE /path/to/DS_Store) This is the file that we just created and moved off of the volume.
Rebuild the DMG file with CPack. Everything should be as viewed before.
As a warning, there's a lot of information that gets stored in the .DS_Store file such as file locations, user names, and the like. At the moment, I don't know how to control this information, so be a little careful when distributing the final DMG file. If you're curious as to what's in there, use a hex editor like xxd.
As a brief comment, this process is very obtuse. That said, I don't think it's Kitware's fault. Though, they could document the process better. From what I can tell, the .DS_Store file format is not well documented or disclosed, so we're basically forced to use Finder to make one for us. This is a MacOS issue that probably should be fixed.

iOS Show some error about PNG image

I am using Xcode 4.3.3, I already tried to build my app before and it run. But now I arranged my files inside my project's folder, grouped them by 'button' , 'icon' , 'background'... I also copied some resources/images in other folder put them in order but now I'm in trouble.
Im trying to build my app again in Xcode, I found a CopyPNG Error:
Can't find /Users/vella/Desktop/Sample/res/2.png
Command /Users/vella/Desktop/installer/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/Xcode/PrivatePlugIns/iPhoneOS Build System Support.xcplugin/Contents/Resources/copypng failed with exit code 1
Now, I don't know if I missed some png files. I also read some answers like I should save PNG files as NOT INTERLACED or there is a PNG file that is corrupted. How will I know what PNG file is missing or corrupted?
Check wheather you added 2.png into your project folder.while adding images into your project,click the checkbox "Copy items into destination group folder".If your png file is corrupted, it will be in red colour in your project.
You have to save your PNG files as NOT INTERLACED. For example, bu using Photoshop, go to menu File->Save For Web and Devices. Unchecked the box of 'Interlaced' and save the file. Usually interlaced box is unchecked already. Hope that helps
Clean up the png file in your project and re-import it:
Delete (backup) that file in project navigator. Just delete and move file to trash can.
Go to project Build Phases:
i. Select the root project
ii. Select TARGETS
iii. Select Build Phases tag
iv. Expand Copy Bundle Resources list
If you see the file you just deleted still exists (maybe in red), delete it
Re-import the file again
This worked for me.
Yep, Add it again and this time dont arrange or rearrange any stuff in your resources folder.
Also give specific naming to the images so that its easy for you to remember and implement them later in ur project.
I just had the same problem. I always do the same thing to add images to my projects but I never had a problem like this before.
I found in the error message that, the image path that Xcode was trying to find the image was wrong. The path that Xcode is searching was like " ...../My Project Folder/images/favourites.png" but the correct path is like "...../My Project Folder/myProjectName/images/favourites.png". To solve this, I create a folder with path " ...../My Project Folder/images", then I backed up my images and deleted all of them from project window and selected "move to trash". I copied and pasted the images from my backup folder to this new folder. Then I drag-dropped them to "Supporting Files" and select "Copy items into destination group's folder (if needed)". Finally I cleaned the project and run it. It worked for me. Good luck.

Script to resize and rename an image AppleScript

I'm getting sick of constantly have to create images and then have to copy, resize and rename to support both retina and non-retina iphones. Is it possible to have a script that does this automatically if you just drag the image to the script?
The original image will be called: image#2x.png... I would like the script to shrink it by 50 % and remove the "#2x" at the end.
Thanks in advance
What I do, in Automator - save as Application
Copy Image, Remove #2x, Shrink
http://new.tinygrab.com/9e397aa2b95f4d2e746e1f5a750eacece89a94dc1b.png
Here's an applescript way. Save this code as an application. You can then 1) drop images on it or 2) double-click it and choose a file. It has code to verify that the dropped file has #2x in its name. If so it scales it and if not nothing happens. I see you already have a solution but I wanted to show applescript has the application "Image Events" which can easily scale an image. Good luck.
property theSeparator : "#2x"
property scaleFactor : 0.5
on run
set f to choose file
processTheFiles({f})
end run
on open theFiles
processTheFiles(theFiles)
end open
on processTheFiles(theFiles)
tell application "Image Events" to launch
repeat with f in theFiles
set thisFile to f as text
if thisFile contains theSeparator then
set savePath to text 1 thru -8 of thisFile & text -4 thru -1 of thisFile
tell application "Image Events"
set a to open f
scale a by factor scaleFactor
save a in savePath
end tell
delay 0.2
end if
end repeat
tell application "Image Events" to quit
end processTheFiles
Be warned that all of these approaches (this one included) neglect pixel-fitting, which must be done by hand.
Googling brought up this Bash script, which requires installing ImageMagick (via MacPorts) but has the advantage of sharpening images by a pixel (or more or less if you desire).
Here it is for your convenience (this script takes a series of filenames from the command line):
#!/bin/sh
IMAGES=$#
RADIUS='1'
SIGMA='0.0'
FILTER=Catrom
for image in $IMAGES
do
/opt/local/bin/convert $image -sharpen ${RADIUS}x${SIGMA} -filter ${FILTER} -resize 50% `basename -s #2x.png $image`.png
done
It is modified from the original version I linked, to not require modifying your $PATH
Here is an alternative approach that does allow for pixel-fitting and also saves you the additional step of running a script on all of your images; Better results & better workflow!
The prerequisite is that you use Adobe Fireworks to make or export your graphics.
My iOS Fireworks extension scripts add commands to the Fireworks commands menu to resize your retina graphics or your app icon to the appropriate sizes and open the export dialog for you. Installation instructions are in the README.
For anyone still looking for a script:
I wrote this python script, which you can find on github: img-asset-creator. The script can create image assets for iOS and Android. The only thing you need is having python3 installed and to make things easier pip. The reason I wrote this script is mainly because I wanted to scale multiple images at the same time without having to rely on an internet connection.
For example if you have an image like pineapple.jpg and you want to have it for iOS in all three sizes with the biggest one to have a width of 1200px you can run the following command:
python3 imgasset.py -iOS -w 1200 pineapple.jpg
The script currently doesn't support shrinking procentual, but I will add that soon.