Although it could be handled more efficiently using other tools, I often find that on restrictive client networks vba is the only means of running my own executable code to do stuff like this, so this is an Excel way.
The attached zip file contains a xlsm file, and 2 subfolders where input and output images are stored. I have included 7 tiny jpg files for illustration purposes.
ResizeImages.zip
- Copy the top-level folder in this zip file to your working folder so that it creates the subfolders and images as well.
- Open the newly copied xlsm file.
- Imported images are sized to fit the shape and size of cell B5, so resize this as you require.
- Change the image in the little picture box to your watermark image (I used a PNG file with transparent background).
- Drag and position this watermark picture where you need it inside of cell B5.
- When run, the Input subfolder is searched for jpg files and processes them when found, saving the converted files to the output folder.
- My test images are quite small, so in this instance, the macro is actually enlarging the picture.
Some tweaking is required, eg. getting rid of the edge artifacts on the output images, but this should give you a good starting point. I also didn't bother with FileSystemObject.
The converter procedure:
Bookmarks