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

Export without crop/trim?

Explorer ,
May 26, 2018 May 26, 2018

Copy link to clipboard

Copied

Hi,

If I create a new image with a transparent layer of say 300x300 pixels and put a white square from half to bottom (x: 0, y: 150, width: 300, height: 150) like this:

ss01.png

When I export this by right clicking the layer and choose "Export As... " it automatically crops the transparency and will give it a height of 150:

ss02.png

If I then change the height to 300 the rectangle gets centered :S (really?... Why?... Seems silly!)

ss03.png

Why would I want this behavior? It seems absolutely unwanted and frustrating because I have exactly what i want in the editor but when I export things change. Why would you do this,?, If I want something cropped or centered I will do it myself in the editor, there is no need for making this decision for me!!!

The File->Export->Layers To Files dialog has a Trim Layers checkbox to deal with this. But I want to be able to export a lot of groups (not layers) at the same time, this dialog cannot handle that because it can solely export layers and has no regards for groups (this will export all layers in a group, and not just the resulting frame). I fail to see the logic for putting the Trim optional in the layers dialog - which can't export groups correctly - and not having this option in the normal export - which will export the groups nicely, but as said has no trim options. :S

Is there anyway I can turn of the crop/trim of the export? Or is there a way to avoid it from centering? Basically I just want it to be exported as is! For my real work I need the transparent pixels above the square and not centered.!

Thanks a lot for any help on this!

Views

33.1K

Translate

Translate

Report

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

Explorer , May 29, 2018 May 29, 2018

Somebody on the feedback.photoshop.com has provided a great solution:

You can put a mask on the root item you wish to export to prevent the Trim from happening: This can be a layer:

ss01.png

Or a group:

ss02.png

Then right the layer or group and choose "Export As...".

Votes

Translate

Translate
Adobe
Community Beginner ,
Apr 21, 2020 Apr 21, 2020

Copy link to clipboard

Copied

EDIT: Testing in Adobe Photoshop Version: 21.1.2 20200410.r.136 2020/04/10: efaf3fa4e40 x64 today, when I am exporting from PSD to PNG, it is now keeping my artboard sizes instead of trimming by default. There still isn't a way to turn it on and off, but perhaps they have changed the default behavior to remove the trimming? 

This test image was exported using export for screens, and keeps the padding:

export for screens PNG transparency testexport for screens PNG transparency test

 

Other way suggested:

Try file>export>layers to files, and de-select "trim:"

 

Everything will come out at the actual artboard size. Then, if you need to perform other operations in batch afterwards, you could use a watermarking action or similar to add in the 1% corner pixels to maintain the full size even when using other PS export modes that DON'T have this needed checkbox.

 

layers_to_files.JPG

Votes

Translate

Translate

Report

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 Beginner ,
Nov 05, 2021 Nov 05, 2021

Copy link to clipboard

Copied

Hi,

 

I just wanted to add that while I was strugeling with the same issues. I've notices that this method of exporting reduces the exported images to 72dpi. Something that I in my current project don't want.

 

 

Votes

Translate

Translate

Report

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 ,
Nov 05, 2021 Nov 05, 2021

Copy link to clipboard

Copied

yes, these moethods are all to optimize your images to save as PNG, JPEG, and GIF. All of which are web based and 72 ppi.

 

If you wanted something for print and wanted to keep resolution high, you might want to Save as a TIFF. But I recommend you ask the printer what they prefer(assuming you wanted to print).

But sometimes it could be a JPEG with at 100%, or even a PNG24 or even a  PDF!

 

Hope that helps.

 

best,

mark

 

mark

Consulting | Design | Motion | Training>headTrix, Inc. | Adobe Certified Training & Consulting<br />Consulting | Design | Development | Training

Votes

Translate

Translate

Report

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 Beginner ,
Nov 06, 2021 Nov 06, 2021

Copy link to clipboard

Copied

Hi Mark,

 

Thanks for getting back, yes. It is very nice for web, however, we are building frame animations for iPad apps. Which have a higher resolution. I know, it's not 'standerd' but I guess most monitors/displays can go higher than 72dpi.

 

 

 

 

Votes

Translate

Translate

Report

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 ,
Nov 06, 2021 Nov 06, 2021

Copy link to clipboard

Copied

HI Adrie,

 

You are welcome! I don't think DPI matters at all when it comes to digital. DPI is more a variable when printing.

You only need to be concered about the height and width. With an iPad app, that people use on the go, I would imagine that you would care a bit about download speed, no? 
All you have to do is create an image for the highest common denominator, the largest screen size for an iPad, and you should be fine. Or do some tests..... and see what looks best. A PNG will indeed be a larger file size, but Probably a JPEG would be the way to go, its a 24 bit compression, like the PNG, but will be smaller in file size.

 

If you need alpha transparency, then you can use the PNG24

 

hope this helps.

mark

Consulting | Design | Motion | Training>headTrix, Inc. | Adobe Certified Training & Consulting<br />Consulting | Design | Development | Training

Votes

Translate

Translate

Report

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 Beginner ,
Nov 09, 2021 Nov 09, 2021

Copy link to clipboard

Copied

Hi Mark,

 

You've just solved something I was trying to figure out for a long time. Offcourse! But, why is the screen res set to 72dpi? Is that the 'orininal' resolution?

Votes

Translate

Translate

Report

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 ,
Nov 09, 2021 Nov 09, 2021

Copy link to clipboard

Copied

hey there,

 

so the screen is set to 72 dpi or ppi (pixels per inch) because when computers were first created they had 72 pixels for every inch. So therefore all images to be displayed on a digital screen would also be exported at 72 ppi.

 

Nowadays I don't think there is a standard screen or standard monitor resolution. Every phone, tv, computer screen and tablet all have more then 72 ppi now - technology has improved, and screens vary tremendously in size.

 

So although 72 ppi is a standard, the truth is that when it comes to anything digital or on screen - it will fill the screen pixel for pixel with the image. ON a small screen or a big screen the image will still take up 200 pixels (as an example), on a phone those might be smaller pixels, but the image will still fit 200 of the pixels, pixel for pixel, and same goes for a large movie screen, the pixels might be large but it will still fill 200 pixels.

 

So basically, even though Photoshop is still using this 72 ppi standard, the truth is all the matters is the HEIGHT and WIDTH in Pixels. The resolution is only important when printing. It does not matter at all when it comes to digital. Do a test for yourself.... make two images the same exact height and width in pixels, and one can be 240 ppip and one can be 72 ppi and they will both look the same online. They will print differently.... but will look the same, have the same quality, and will have the same height and width.

 

Hope that helps!

best,

mark

Consulting | Design | Motion | Training>headTrix, Inc. | Adobe Certified Training & Consulting<br />Consulting | Design | Development | Training

Votes

Translate

Translate

Report

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 Beginner ,
Nov 10, 2021 Nov 10, 2021

Copy link to clipboard

Copied

Wow! It all makes perfect sense now. Thank you so much!

Votes

Translate

Translate

Report

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
Guest
Nov 10, 2021 Nov 10, 2021

Copy link to clipboard

Copied

Awesome. Glad I was able to help! Now get to work! Ha! I'm teasing... have a great day!

 

Best 

Mark

Votes

Translate

Translate

Report

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 ,
Nov 11, 2021 Nov 11, 2021

Copy link to clipboard

Copied

That was weird. Somehow it looks like I have two accounts. Anyhow i wanted to reply properly!

Glad I was able to help! Now get to work! Ha! I'm teasing... have a great day!

 

Best 

Mark

Consulting | Design | Motion | Training>headTrix, Inc. | Adobe Certified Training & Consulting<br />Consulting | Design | Development | Training

Votes

Translate

Translate

Report

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 Beginner ,
Nov 12, 2021 Nov 12, 2021

Copy link to clipboard

Copied

Hi Mark, no worries! Thanks to you the work is done. And on time! Thanks again. You've been a great help. 

Votes

Translate

Translate

Report

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 ,
Nov 12, 2021 Nov 12, 2021

Copy link to clipboard

Copied

Hi Adrie,

 

what a sweet message! Thank you! I am happy I was able to help!

All the best,

mark

Consulting | Design | Motion | Training>headTrix, Inc. | Adobe Certified Training & Consulting<br />Consulting | Design | Development | Training

Votes

Translate

Translate

Report

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 22, 2022 Feb 22, 2022

Copy link to clipboard

Copied

Hi Mark, thanks for your insight to this matter. Can I possibly piggyback this feed.

I need to export multiple layers from a .psd doc and they need to retain the canvas size and be 300dpi sRGB PNG files. I understand PNG files aren't made for print and PDF and JPEG would be more suitable, but in this case the requirements are 300dpi sRGB PNG – any help or giudance would be much appreciated. Thank you! 

Votes

Translate

Translate

Report

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 ,
Mar 03, 2022 Mar 03, 2022

Copy link to clipboard

Copied

Hello Holmes. 

Apologies for mylate reply but I was traveling in the Domincan Republic. 

 

So in order to export files as 300 dpi, the file itself should be created at 300dpi. Then you can just export layers to files by selecting File>Export>Layers to Files then browse to where you want to save the fiels and select "PNG24"and VOILA! your done! Easy Peezy!

 

Hope that helps!

mark

Consulting | Design | Motion | Training>headTrix, Inc. | Adobe Certified Training & Consulting<br />Consulting | Design | Development | Training

Votes

Translate

Translate

Report

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 ,
Mar 03, 2022 Mar 03, 2022

Copy link to clipboard

Copied


@Holmes24 wrote:

I need to export multiple layers from a .psd doc and they need to retain the canvas size and be 300dpi sRGB PNG files. I understand PNG files aren't made for print and PDF and JPEG would be more suitable, but in this case the requirements are 300dpi sRGB PNG – any help or giudance would be much appreciated. Thank you! 


 

Exporting PNG strips resolution metadata, Save As a Copy to PNG uses PPM, or pixels per metre – not PPI. When opened back into Photoshop, this is translaed to PPI/PPCM.

 

A 300 ppi save as PNG from Photoshop would embed a value of 11811 ppm (pixels per metre). When Photoshop opens a PNG with this resolution metadata, it performs an “on the fly translation” from PPM to PPI:

 

118.11 x 2.54 = 299.9994 ppi... rounded up this is 300 ppi.

 

Presuming that your images are already set to 300ppi and that they are already sRGB you can use the following script to save as PNG for all root/top-level layers and groups/sets:

 

 

 

/*
All top level layers saved to PNG.jsx
https://community.adobe.com/t5/photoshop-ecosystem-discussions/how-do-i-export-layers-as-png-without-loosing-the-size-and-placement-of-the-particular-layer/m-p/12734226
Stephen Marsh, 5th February 2022 - v1.0
Based on:
https://damienfremont.com/2019/05/25/how-to-photoshop-script-export-layers-to-png-files/
Note: Existing files will be overwritten!
*/

#target photoshop

if (app.documents.length > 0) {

    try {
        var outputPath = app.activeDocument.path.fsName;
    } catch (e) {
        var outputPath = Folder.selectDialog("Unsaved base file, select the output folder:");
    }

    for (var i = 0; i < app.activeDocument.layers.length; i++) {
        for (var j = 0; j < app.activeDocument.layers.length; j++) {
            app.activeDocument.layers[j].visible = false;
        }
        var layerIndex = i;
        app.activeDocument.layers[layerIndex].visible = true;

        var layerName = app.activeDocument.layers[layerIndex].name.replace(/[^a-z0-9 _-]/gi, '').replace(/ +|-+|_+$/g, '');
        var filename = app.activeDocument.name.replace(/\.[^\.]+$/, '');
        var file = new File(outputPath + "/" + filename + "_" + layerName + ".png");
        
        var saveOptions = new PNGSaveOptions();
        saveOptions.compression = 0; // 0-9
        saveOptions.interlaced = false;
        app.activeDocument.saveAs(file, saveOptions, true, Extension.LOWERCASE);
    }
    alert("PNG files saved to:" + "\r" + outputPath);

} else {
    alert("You must have a document open!");
}

 

 

 

https://prepression.blogspot.com/2017/11/downloading-and-installing-adobe-scripts.html

 

EDIT: Save As PNG does not include the sRGB profile. Export can include the profile, but not the resolution metadata. I personally would use a third party tool such as ExifTool to batch embedd the sRGB ICC profile. Alternatively, export out retaining the sRGB ICC profile and use ExifTool to embed the resolution metadata. It appears that Photoshop 2022 (v23.2.1) still can't do both!

Votes

Translate

Translate

Report

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
New Here ,
Aug 05, 2020 Aug 05, 2020

Copy link to clipboard

Copied

Have you tried Layer Comps? Create a comp for each of your layers or combination of, name them as you want the files named, then "File>Export>Layer Comps to Files...", and delete the Prefix and uncheck the Index. This should produce untrimmed images.

Votes

Translate

Translate

Report

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 Beginner ,
May 29, 2021 May 29, 2021

Copy link to clipboard

Copied

I was having a similar issue (https://community.adobe.com/t5/photoshop/export-as-automatically-trims-transparent-pixels/m-p/120490...). Based on replies there, I did come up with a solution: Ad a full-sized layer mask to a layer being exported. A mask with all pixels 255,255,255 (fully visible). This "tricks" the interface into thinking those are relevant pixels to export.

Adding barely-visible pixels is not a viable option. Optically invisible pixels are not mathematically invisible, if a computer needs to interpret the exported PNG.

Votes

Translate

Translate

Report

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
New Here ,
Oct 06, 2021 Oct 06, 2021

Copy link to clipboard

Copied

The masking option had been working perfectly for me until the 22.5.1 release. Even with a blank, full page layer mask, the Export As window now trims layers and groups. Anyone found a new fix for this?

Votes

Translate

Translate

Report

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
New Here ,
Oct 22, 2021 Oct 22, 2021

Copy link to clipboard

Copied

YES! This is happening to me as well with the 22.5.1 release. Previously applying the same mask to different layers and then selecting all layers and then "Quick Export as PNG" was a quick way to create PNGs that were all the same size (used for sprites and other CSS animations). Now this version only recognizes the image area of the layer.

Votes

Translate

Translate

Report

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
New Here ,
Dec 20, 2021 Dec 20, 2021

Copy link to clipboard

Copied

Just chiming in to say I'm having the same problem on the latest release. The presence of layer masks no longer affect the auto-trim. I downloaded the previous version of Photoshop to use for exports but that doesn't seem like a good long-term solution!

Votes

Translate

Translate

Report

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
New Here ,
Jan 18, 2022 Jan 18, 2022

Copy link to clipboard

Copied

I have the same issue in PS 2022... Though I don't want to save as PNG, but SVG. I'm using legacy export as to get the SVG export option there.

 

I'm making a font and I have all the letters, numbers and special characters on separate vector layers, positioned carefully on a specific sized canvas with enough transparent space around the letters, so they fit the font creation program's template. Without the trimming I could export all 75+ layers at once, by selecting them and right-click -> exporting, but now I need to export them all separately, which takes insane amount of time.

 

This has been an issue earlier as well in multiple projects and I can't believe it's still not fixed. It could be handy in other settings surely, but in many cases makes work unnecessarily slow. It could be a checkbox feature.

Votes

Translate

Translate

Report

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 Beginner ,
Dec 15, 2023 Dec 15, 2023

Copy link to clipboard

Copied

Masking doesnt work for me. Its infuritating how theres like 19 ways to now export stuff from photoshop, when it used to all be so much simpler. Photoshop has never been intuitive, but they just keep making it worse.

Votes

Translate

Translate

Report

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