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

Can I turn slices into layers?

Explorer ,
Sep 20, 2019 Sep 20, 2019

Copy link to clipboard

Copied

I thought slices would be the answer to dividing up this image into even sections but I can't figure out how to make each slice it's own layer. Can anyone help with this? Thanks!

Screen Shot 2019-09-20 at 1.20.22 PM.png

Views

1.5K

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
Adobe
Community Expert ,
Sep 20, 2019 Sep 20, 2019

Copy link to clipboard

Copied

Slices are designed to produce separate files that can be place together on a web page, not for separate layers. Only option I can think of is to create those files then import them back into layers. Of course you will have to position them manually.

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 ,
Sep 20, 2019 Sep 20, 2019

Copy link to clipboard

Copied

Thanks!

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 ,
Sep 20, 2019 Sep 20, 2019

Copy link to clipboard

Copied

Can I ask what you hope to gain from slicing your image this way?   And what will the final image be used for?

Nancy O'Shea— Product User, Community Expert & Moderator

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 ,
Sep 20, 2019 Sep 20, 2019

Copy link to clipboard

Copied

I wanted to use the separate images in a Timeframe to create a scrolling animation to be used in a mockup.

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 ,
Dec 01, 2024 Dec 01, 2024

Copy link to clipboard

Copied

LATEST

Wouldn't it be easier to just keyframe the animation with a video layer and then export as video or GIF?


---------
Adobe Community Expert: "Gewusst wie, spart Energie." 

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 ,
Sep 20, 2019 Sep 20, 2019

Copy link to clipboard

Copied

If you want to just split up the image to do a timeline animation, I would have just used the marquee tool, the presses shift-ctrl/cmd-J to place the selected part of the base layer on a new layer, and to delete it from the base 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
Community Expert ,
Sep 21, 2019 Sep 21, 2019

Copy link to clipboard

Copied

Try this script by SuperMerlin. You'll need to change the values for the tilesAcross and tilesDown variables:

 

// Cutting image in parts - by SuperMerlin
// forums.adobe.com/thread/2307015
#target photoshop  
if(documents.length){  
var startRulerUnits = preferences.rulerUnits;  
preferences.rulerUnits = Units.PIXELS;  
doc = app.activeDocument;  
app.displayDialogs = DialogModes.NO;  
doc.flatten();  
var tilesAcross =1;  // How many across the width?
var tilesDown =2;  // How many down the depth?
var tileWidth = parseInt(doc.width/tilesAcross);  
var tileHeight = parseInt(doc.height/tilesDown);  
ProcessFiles(tilesDown,tilesAcross,tileWidth,tileHeight);  
app.preferences.rulerUnits = startRulerUnits;        
}  
function ProcessFiles(Down,Across,offsetX,offsetY){  
    try{  
var newName = activeDocument.name.match(/(.*)\.[^\.]+$/)[1];  
}catch(e){var newName="UntitledChop"}  
TLX = 0;    TLY = 0;    TRX = offsetX;    TRY = 0;  
BRX = offsetX;    BRY = offsetY;    BLX = 0;    BLY = offsetY;  
    for(var a = 0; a < Down; a++){  
        for(var i = 0;i <Across; i++){  
            var NewFileName = newName +"#"+a+"-"+i;  
                activeDocument.selection.select([[TLX,TLY],[TRX,TRY],[BRX,BRY],[BLX,BLY]], SelectionType.REPLACE, 0, false);   
                    executeAction( charIDToTypeID( "CpTL" ), undefined, DialogModes.NO );  
                activeDocument.activeLayer.name = NewFileName;  
                app.activeDocument.selection.deselect();  
                activeDocument.activeLayer = activeDocument.artLayers.getByName("Background");  
TLX = offsetX * (i+1) ;    TRX  = TLX + offsetX;    BRX = TRX;    BLX = TLX;          
        }  
TLX = 0;    TLY = offsetY * (a +1); TRX = offsetX;    TRY = offsetY * (a +1);  
BRX = offsetX;    BRY = TRY + offsetY; BLX = 0;    BLY = (offsetY * (a +1)+offsetY);      
    }  
};  

 

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

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 ,
Dec 01, 2024 Dec 01, 2024

Copy link to clipboard

Copied

Here's a quick script interface to help make the script more accessible without having to edit the code:

/* 
ScriptUI interface added to the original script by SuperMerlin
Note: Intended for flattened or single layer files
*/

#target photoshop;

if (documents.length) {
    var dlg = new Window('dialog', 'Tile Image to Layers');
    dlg.alignChildren = 'fill';

    var panel = dlg.add('panel', undefined, '');
    panel.alignChildren = 'fill';

    panel.tileAcrossGrp = panel.add('group');
    panel.tileAcrossGrp.add('statictext', undefined, 'Tiles Across:');
    var tilesAcrossInput = panel.tileAcrossGrp.add('editnumber', undefined, '2');
    tilesAcrossInput.preferredSize.width = 50;

    panel.tileDownGrp = panel.add('group');
    panel.tileDownGrp.add('statictext', undefined, 'Tiles Down:  ');
    var tilesDownInput = panel.tileDownGrp.add('editnumber', undefined, '2');
    tilesDownInput.preferredSize.width = 50;

    var buttonGroup = dlg.add('group');
    buttonGroup.alignment = 'center';

    var cancelBtn = buttonGroup.add('button', undefined, 'Cancel');
    cancelBtn.onClick = function () {
        dlg.close();
    };

    var okBtn = buttonGroup.add('button', undefined, 'OK');
    okBtn.onClick = function () {
        var tilesAcross = parseInt(tilesAcrossInput.text);
        var tilesDown = parseInt(tilesDownInput.text);
        dlg.close();
        runTileScript(tilesAcross, tilesDown);
    };

    dlg.show();
}

function runTileScript(tilesAcross, tilesDown) {
    var startRulerUnits = preferences.rulerUnits;
    preferences.rulerUnits = Units.PIXELS;
    var doc = app.activeDocument;
    app.displayDialogs = DialogModes.NO;
    doc.flatten();
    var tileWidth = parseInt(doc.width / tilesAcross);
    var tileHeight = parseInt(doc.height / tilesDown);
    ProcessFiles(tilesDown, tilesAcross, tileWidth, tileHeight);
    app.preferences.rulerUnits = startRulerUnits;
}

function ProcessFiles(Down, Across, offsetX, offsetY) {
    try {
        var newName = activeDocument.name.match(/(.*)\.[^\.]+$/)[1];
    } catch (e) {
        var newName = "UntitledChop";
    }
    var TLX = 0, TLY = 0, TRX = offsetX, TRY = 0;
    var BRX = offsetX, BRY = offsetY, BLX = 0, BLY = offsetY;
    for (var a = 0; a < Down; a++) {
        for (var i = 0; i < Across; i++) {
            var NewFileName = newName + "#" + a + "-" + i;
            activeDocument.selection.select([[TLX, TLY], [TRX, TRY], [BRX, BRY], [BLX, BLY]], SelectionType.REPLACE, 0, false);
            executeAction(charIDToTypeID("CpTL"), undefined, DialogModes.NO);
            activeDocument.activeLayer.name = NewFileName;
            app.activeDocument.selection.deselect();
            activeDocument.activeLayer = activeDocument.artLayers.getByName("Background");
            TLX = offsetX * (i + 1);
            TRX = TLX + offsetX;
            BRX = TRX;
            BLX = TLX;
        }
        TLX = 0;
        TLY = offsetY * (a + 1);
        TRX = offsetX;
        TRY = offsetY * (a + 1);
        BRX = offsetX;
        BRY = TRY + offsetY;
        BLX = 0;
        BLY = (offsetY * (a + 1) + offsetY);
    }
}

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 ,
Dec 01, 2024 Dec 01, 2024

Copy link to clipboard

Copied

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