Copy link to clipboard
Copied
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!
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,
...
Copy link to clipboard
Copied
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 ?
Copy link to clipboard
Copied
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:
Copy link to clipboard
Copied
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?
Copy link to clipboard
Copied
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!
Copy link to clipboard
Copied
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)
Copy link to clipboard
Copied
It's where Adobe designed it to be! :]
Copy link to clipboard
Copied
Generator uses Quick Export, which for some reason has no way to embed the profile. That renders it useless to me.
Copy link to clipboard
Copied
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
@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.