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

Generate image assets from layers losing, Color Profiles

Explorer ,
Feb 19, 2024 Feb 19, 2024

Hello!
I am used to work with generating asset from layers through naming my artboards, as suggested in this link.
https://helpx.adobe.com/photoshop/using/generate-assets-layers.html

But recently I noticed that when I do use this feature, images are generated correctly… a part for their color profiles which are lost during the process. For example: sRGB becomes a random RGB

Is their any way to keep colorprofiles of the initial file when assets are generated ?
Thank you!

TOPICS
macOS , Web , Windows
897
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

correct answers 1 Correct answer

Community Expert , Feb 20, 2024 Feb 20, 2024

@Ernesto TK 

 

As the configuration file is a plain text JSON formatted .js file, you could manually update it instead of using the Generator Config panel.

 

EDIT: here is a copy of the default generator.js file created in the current user's ~/ home directory using the extension:

 

module.exports = {
    "generator-assets": {
        "svg-enabled": true,
        "svgomg-enabled": true,
        "css-enabled": false,
        "use-smart-scaling": false,
        "include-ancestor-masks": false,
    
...
Translate
Adobe
Explorer ,
Feb 20, 2024 Feb 20, 2024

I found this:
https://github.com/adobe-photoshop/generator-assets

But It doesn't work with last Mac M1 builds, is there any alternative for M1 macs ? 

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
Community Expert ,
Feb 20, 2024 Feb 20, 2024

@Ernesto TK 

 

As the configuration file is a plain text JSON formatted .js file, you could manually update it instead of using the Generator Config panel.

 

EDIT: here is a copy of the default generator.js file created in the current user's ~/ home directory using the extension:

 

module.exports = {
    "generator-assets": {
        "svg-enabled": true,
        "svgomg-enabled": true,
        "css-enabled": false,
        "use-smart-scaling": false,
        "include-ancestor-masks": false,
        "allow-dither": false,
        "use-psd-smart-object-pixel-scaling": false,
        "use-pngquant": true,
        "convert-color-space": false,
        "use-flite": true,
        "embed-icc-profile": false,
        "clip-all-images-to-document-bounds": true,
        "clip-all-images-to-artboard-bounds": true,
        "mask-adds-padding": true,
        "expand-max-dimensions": false,
        "webp-enabled": false,
        "interpolation-type": "bicubicAutomatic"
    }
}

 

Simply change the boolean value from false to true:

 

"embed-icc-profile":true,

 

Restart Photoshop and your Generator JPEG files should now include the ICC profile of the source document.

 

P.S. Here is a copy with all options on and the three dropdown menus set from the defaults:

 

module.exports = {
    "generator-assets": {
        "svg-enabled": true,
        "svgomg-enabled": true,
        "css-enabled": true,
        "use-smart-scaling": true,
        "include-ancestor-masks": true,
        "allow-dither": true,
        "use-psd-smart-object-pixel-scaling": true,
        "use-pngquant": true,
        "convert-color-space": true,
        "use-flite": true,
        "embed-icc-profile": true,
        "clip-all-images-to-document-bounds": true,
        "clip-all-images-to-artboard-bounds": true,
        "mask-adds-padding": true,
        "expand-max-dimensions": true,
        "webp-enabled": true,
        "interpolation-type": "bicubic",
        "icc-profile": "sRGB IEC61966-2.1",
        "use-jpg-encoding": "optimal"
    }
}

 

 

EDIT: Another option to create the generator.js configuration file:

 

https://community.adobe.com/t5/photoshop-ecosystem-discussions/online-quot-generator-quot-config-fil...

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
Explorer ,
Feb 20, 2024 Feb 20, 2024

Thank you for your answer! I will try!
Where can I find this file ? (I am in a Mac ecosystem) 
In the application support folder or any hidden preferences folder ? 

Edit: Should I create a text file, copy/paste the code lines and save them as a generator.js in my "home" folder?


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
Community Expert ,
Feb 20, 2024 Feb 20, 2024
quote

Edit: Should I create a text file, copy/paste the code lines and save them as a generator.js in my "home" folder?



By @Ernesto TK


Yes!

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
Explorer ,
Feb 20, 2024 Feb 20, 2024

That's perfect! I tried It and it worked perfectly.

I am just curious about why does this file can be found in the home directory and not in a more specific folder (like preferences or config) do you know why ?

Thank you again for your help! It is once again, greatly appreciated!
(You already helped my last week with the artboards and .csv's, and it works perfectly as well)

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
Community Expert ,
Feb 20, 2024 Feb 20, 2024
LATEST
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
Community Expert ,
Feb 20, 2024 Feb 20, 2024

Generator uses Quick Export, which for some reason has no way to embed the profile. That renders it useless to me.

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
Community Expert ,
Feb 20, 2024 Feb 20, 2024

@D Fosse 

 

You can now take another look at Generator!

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
Community Expert ,
Feb 20, 2024 Feb 20, 2024

Indeed I can! Your scripts, over time, have amended a lot of the shortcomings in Photoshop - but I think this one in particular should have been fixed at the factory. This is basic functionality that should just be there.

 

So my post was just pointing out why the profile isn't embedded to begin with.

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
Community Expert ,
Feb 20, 2024 Feb 20, 2024

@D Fosse wrote:

So my post was just pointing out why the profile isn't embedded to begin with.


 

I don't know why Adobe elected to use the good old "Beware of the Leopard" marketing routine... The configuration file option is advanced, however, it appears to be an integral part of Generator that was never adequately mentioned in mainstream documentation or natively made user-friendly.

 

As for Export As, it appears to be a major work-in-progress!  :]  My guess is that this is tied to the infancy of UXP.

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