Copy link to clipboard
Copied
Hello. Due to my work, I receive a lot of Base64 images, which I always have to convert to PNG to use in Photoshop. With one or two files this is not a problem, but with a large amount it is tedious and repetitive work. Currently I use an online converter, but it takes a lot of time to upload, convert, download, import into Photoshop, so I would like to improve my workflow and speed it up.
Can you offer me a solution?
I almost forgot: I use Windows 10.
An example from the Mac... The process would be similar if you install Python3 in Windows.
Here is the cross platform Python3 script code as linked previously. This is the decode.py file:
The input.txt file in the user's download folder has three base64 encoded strings, one per line for each image:
Working in the Downloads folder, here is the python3 command line code in Terminal.app:
The output images are written to the root/top-level user account "home" folder (not the Downlo
...Copy link to clipboard
Copied
These would be text files, wouldn't they? The binary image data is encoded into ASCII text.
I'd suggest that you search the web for:
windows batch decode base64 to image
Copy link to clipboard
Copied
They arrive in a database, from where I can export them to, for example, a .csv file.
Then I would need a batch file to split .csv and decode it one by one.
Thanks for the tip, I will try it.
Copy link to clipboard
Copied
They arrive in a database, from where I can export them to, for example, a .csv file.
Then I would need a batch file to split .csv and decode it one by one.
Thanks for the tip, I will try it.
By @Csaba32068154j718
Although JavaScript can decode Base64 into an image for display in a ScriptUI interface, I am not aware of a way to render and save actual image files.
This turns out to be surprisingly simple in Python!
https://superuser.com/questions/1498215/how-to-bulk-convert-base64-to-images-in-an-excel-file
Copy link to clipboard
Copied
An example from the Mac... The process would be similar if you install Python3 in Windows.
Here is the cross platform Python3 script code as linked previously. This is the decode.py file:
The input.txt file in the user's download folder has three base64 encoded strings, one per line for each image:
Working in the Downloads folder, here is the python3 command line code in Terminal.app:
The output images are written to the root/top-level user account "home" folder (not the Downloads folder):
image0001.png
image0002.png
image0003.png
Obviously a whole lot more can be done, however this is a simple way to batch convert locally.
Copy link to clipboard
Copied
As an alternative to quickly convert Base64 images: the latest betas of PhotoLine support pasting Base64 directly and converts it to an image. Handy and quick if you have a smaller batch to convert.
CTRL-E will create a new image and paste the converted Base64 code with just one keyboard action. š
The latest beta can be downloaded here:
https://www.pl32.com/forum3/viewtopic.php?f=1&t=6964
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Along the lines of your Python idea, I created a JavaScript code using ChatGPT that basically does what you suggested. Thanks a lot for your help.
Copy link to clipboard
Copied
Along the lines of your Python idea, I created a JavaScript code using ChatGPT that basically does what you suggested. Thanks a lot for your help.
By @Csaba32068154j718
Please do share the JSX code! I would have offered it if I could, but once I found an existing Python script I stopped my research.