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

Export slices while keeping their position within the canvas

Community Beginner ,
Jan 31, 2022 Jan 31, 2022

Hello, I have a 1024px picture which I divide into 16 square slices with the guides and the slice tool in Photoshop. I want to export each slice as an individual png image but keeping their position within  the 1024px canvas. When I export with this method, it exports all slices separately but each resulting image is 256px wide. What I need is exporting the orginal 1024px square canvas picture with each slice showing up individually in separate pictire while keeping its position within the canvas.

Manually it would be: select each 256px slice and copy paste it into a different layer, and then export each layer separately. Which is very time consuming and I would want to know if there is an automatic way of doing this. Thanks.

TOPICS
Actions and scripting
1.1K
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
Adobe
Community Expert ,
Jan 31, 2022 Jan 31, 2022
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
LEGEND ,
Jan 31, 2022 Jan 31, 2022

Posting images and uploading your files increases your chances to be better served.

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 ,
Jan 31, 2022 Jan 31, 2022

Good suggestion, visuals always help.

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 ,
Jan 31, 2022 Jan 31, 2022

@Tom229191967j54 


Ah, I see where you're coming from. I think that I misunderstood... Reading again it sounds like a request for revealing each slice, maintaining canvas size as transparent pixels. Not something originally intended by slice and save for web.

 

The script from jazz-y in the first link will copy each slice to a separate layer as a start point. There are other scripts which can divide using guides. It will be a matter of retaining canvas size and transparency for each layer.

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
LEGEND ,
Jan 31, 2022 Jan 31, 2022

3 hours ago I recieved E-Mail notification with your post but starting with: @Ladxenmark

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 Beginner ,
Jan 31, 2022 Jan 31, 2022

Hello, thank you. I have done some progress. I managed to automatically split the image into the 16 slices and get each slice into its layer, through the script mentioned in the first link. The so called Pfaffenbichler script. 

 

So, up to this point what I did is:

1. Open the 1024px square image

2. New Guides Layout 4 columns 4 rows. 

3. Select slice tool. Enable Slices from guides which I don't see clearly when it's activated.

4. Run the mentioned script.

5. The result is that now, I have 16 layers each containing a 256px square slice.

 

From this point I don't know how to export each layer as png while keeping its position within the canvas, thus, each png should have the original canvas size of 1024 x 1024. I tried with the File > Export > Layers to Files tool, but it does not happen anything and Photoshop gets frozen.

 

So I attach the sample picture and the desired results.

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 Beginner ,
Jan 31, 2022 Jan 31, 2022

I finally managed to do it with this other script as a second step: https://damienfremont.com/2019/05/25/how-to-photoshop-script-export-layers-to-png-files/

 

Excellet. Thank you all very much for your help. Very nice to see so much help in this forum.

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
LEGEND ,
Jan 31, 2022 Jan 31, 2022

This script doesn't export layers but save them.

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 Beginner ,
Jan 31, 2022 Jan 31, 2022

Hum, I'm not sure I understand the different between export and save. It saves the pcitures in png on a local folder, just like I needed it to be.

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
LEGEND ,
Jan 31, 2022 Jan 31, 2022

Export is usually for single layers, often used for web, and can be free of metadata.

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
LEGEND ,
Jan 31, 2022 Jan 31, 2022

Could you link as to that c.pfaffenbichler script?

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 Beginner ,
Jan 31, 2022 Jan 31, 2022

Sure, the script I used for placing each slice into a separate layer is: https://community.adobe.com/t5/photoshop-ecosystem-discussions/divide-my-image-to-layers/m-p/1246752... The script that starts with

// split Image to layer according to guides;

 

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
LEGEND ,
Jan 31, 2022 Jan 31, 2022
LATEST

Okay, now I see it in post of recently died JJMack

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