Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
1

Base64 Encoding Support Needed in Photoshop

Explorer ,
Oct 03, 2024 Oct 03, 2024

Photoshop currently lacks native support for exporting images in base64 format, a crucial feature for web developers who often embed images directly into HTML or CSS.

Adding the ability to export images as base64 would greatly improve the workflow for developers, eliminating the need for external tools or manual conversions. This would make it easier to integrate images seamlessly into code and enhance productivity for those working on web projects.

Considering that base64 is a widely used format in modern web development, including it in Photoshop would help maintain its position as an essential tool for digital professionals.

Idea No status
TOPICS
macOS , Windows
193
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
1 Comment
LEGEND ,
Oct 03, 2024 Oct 03, 2024
LATEST

Base64 is not a format. Its a legacy way to encode binary files so they can be sent via Internet gateways as plain text (along with uuencode and MacBinary.)

https://developer.mozilla.org/en-US/docs/Glossary/Base64

You should use an encoding tool or script, Base64 is actually available natively on both Mac and Windows.

Below is a sample Bridge script (several years old, not tested on Windows 11 or macOS Sonoma/Sequoia) that demos how to use Base64 coding and decoding. Just so you are aware what is possible.

/*
Utility Pack Scripts created by David M. Converse ©2018-21

This script is a demo of using system Base64 functions

Last modified 6/2/2021

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
#target bridge
if(BridgeTalk.appName == 'bridge'){
    var BaseSixFourCmd = MenuElement.create('command', 'Base64 Demo', 'at the end of Tools'); //create new menu command
    
    BaseSixFourCmd.onSelect = function(){
        try{
            var txtFile =  '~/Desktop/img1.txt';
            var imgFile = '~/Desktop/img1.png';
            
            var F = new File(txtFile).saveDlg('Create Base64 File', '*.txt'); //create text file         
            var G = new File(imgFile).saveDlg('Create png File', '*.png'); //create png file
            
            BaseSixFourDecode();
            File(F).remove();
            BaseSixFourEncode();

            function BaseSixFourDecode(){
                var testfile = 'iVBORw0KGgoAAAANSUhEUgAAAAoAAAAOCAYAAAAWo42rAAAACXBIWXMAAAsTAAALEwEAmpwYAAAGxGlUWHRYTUw6Y29tLmFkb2JlLnhtcAAAAAAAPD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQiPz4gPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iQWRvYmUgWE1QIENvcmUgNS42LWMxNDUgNzkuMTYzNDk5LCAyMDE4LzA4LzEzLTE2OjQwOjIyICAgICAgICAiPiA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPiA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtbG5zOmRjPSJodHRwOi8vcHVybC5vcmcvZGMvZWxlbWVudHMvMS4xLyIgeG1sbnM6cGhvdG9zaG9wPSJodHRwOi8vbnMuYWRvYmUuY29tL3Bob3Rvc2hvcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RFdnQ9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZUV2ZW50IyIgeG1wOkNyZWF0b3JUb29sPSJBZG9iZSBQaG90b3Nob3AgQ0MgMjAxOSAoTWFjaW50b3NoKSIgeG1wOkNyZWF0ZURhdGU9IjIwMTktMDMtMTNUMTg6NTM6NDEtMDQ6MDAiIHhtcDpNb2RpZnlEYXRlPSIyMDE5LTAzLTEzVDIwOjEyOjAy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PHJkZjpsaSBzdEV2dDphY3Rpb249InNhdmVkIiBzdEV2dDppbnN0YW5jZUlEPSJ4bXAuaWlkOjgxNGM0YjdhLWJiZGQtNGVjOC1hYTRjLTIzMGIyNzE0YmI4NyIgc3RFdnQ6d2hlbj0iMjAxOS0wMy0xM1QyMDoxMjowMi0wNDowMCIgc3RFdnQ6c29mdHdhcmVBZ2VudD0iQWRvYmUgUGhvdG9zaG9wIENDIDIwMTkgKE1hY2ludG9zaCkiIHN0RXZ0OmNoYW5nZWQ9Ii8iLz4gPC9yZGY6U2VxPiA8L3htcE1NOkhpc3Rvcnk+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+AQeTEwAAAVJJREFUKJG1zDsvQ2EAxvH/e85pe9qmnEt7Lq26xS1REZtPwGIRkSYmH8BisZNIzBKfQWK2GFnEZDRQlxRxQiUaUuWcvgYVg6WLZ3mWX/5CSkknUzpS/wLFQWkCGUrkR5Po8rz0XiguvJnm+NTVxbY+NHZs9Q1GmBk0hABF6Y/q9a0Iypm7Kr13VdKwmK4978u+wRUBN4oQIh7Vgt3wKSgnARPIAXnAvb2eS9WCfamqaU0ED7OfQTCdaiMbcAE9oYPnkmo2SgI5r90LZbUH6AKygAfoug75PHg+WCaxrLOmxWKJoglYP6VkEnwf/DzksmAYqMMjnjKgip0/Jd8Hx/mGrgON1yMlXejdy1h2IwG/yG0j2wY7h6hUNhVVT97TbSy3RkYf8TwwDTCM9luvqLEl4olTTYYhtFp7zULxJJqc2NBtZ0Y1DYjCQ/FSX0eLnwF8AY6rXfuh6xyTAAAAAElFTkSuQmCC'; //Base64-encoded png file
                
                F.open('w'); //write string to text file
                F.write(testfile);
                F.close();
                
                if(Folder.fs == 'Windows'){
                    var command = 'certutil -decode "' + F.fsName + '" "' + G.fsName + '"'; //system decode
                    }
                else{
                    command = 'openssl base64 -d -A -in "' + F.fsName + '" -out "' +  G.fsName + '"'; //system decode
                    }
                app.system(command);
                }

            function BaseSixFourEncode(){
                if(Folder.fs == 'Windows'){
                    var command = 'certutil -encode "' + G.fsName + '" "' + F.fsName + '"'; //system encode
                    }
                else{
                    command = 'openssl base64 -in "' + G.fsName + '" -out "' +  F.fsName + '"'; //system encode
                    }
                app.system(command);
                }
            }
        catch(e){
            alert(e + e.line);
            }
        }
    }
Translate
Report