RetouchPRO

Go Back   RetouchPRO > Technique > Photo Retouching
Register Blogs FAQ Site Nav Search Today's Posts Mark Forums Read


Photo Retouching "Improving" photos, post-production, correction, etc.

A way to delete all alpha channels at once?

Reply
 
Thread Tools
  #21  
Old 04-17-2013, 09:04 AM
Der_W's Avatar
Der_W Der_W is offline
Senior Member
 
Join Date: Jul 2009
Location: Germany
Posts: 558
Re: A way to delete all alpha channels at once?

Since you seem to be working with shift's version of the script and I don't use OSX it's hard to tell, but try editing the script and in line 31 delete the extra space so that:
var idMk = charIDToTypeID( "Mk " );
becomes
var idMk = charIDToTypeID( "Mk" );

However no guarantee this'll work as I just said .
Reply With Quote top
  #22  
Old 04-17-2013, 10:32 AM
mantra's Avatar
mantra mantra is offline
Senior Member
 
Join Date: Apr 2010
Location: Rome
Posts: 285
Re: A way to delete all alpha channels at once?

Quote:
Originally Posted by Der_W View Post
Since you seem to be working with shift's version of the script and I don't use OSX it's hard to tell, but try editing the script and in line 31 delete the extra space so that:
var idMk = charIDToTypeID( "Mk " );
becomes
var idMk = charIDToTypeID( "Mk" );

However no guarantee this'll work as I just said .
sadly doesn't work
by the way it's a windows with a visual style
using the plugin i got and works

Code:
var id3 = charIDToTypeID( "Dlt " );
    var desc2 = new ActionDescriptor();
    var id4 = charIDToTypeID( "null" );
        var ref1 = new ActionReference();
        var id5 = charIDToTypeID( "Gd  " );
        var id6 = charIDToTypeID( "Ordn" );
        var id7 = charIDToTypeID( "Al  " );
        ref1.putEnumerated( id5, id6, id7 );
    desc2.putReference( id4, ref1 );
executeAction( id3, desc2, DialogModes.NO );
thanks Jonas

Last edited by mantra; 04-17-2013 at 10:45 AM.
Reply With Quote top
  #23  
Old 02-17-2016, 02:13 AM
HubertPLPoznan HubertPLPoznan is offline
Junior Member
 
Join Date: Feb 2016
Posts: 1
Re: A way to delete all alpha channels at once?

Hello, I need to have a script that removes only the all Alpha channels.
The script has to leave the all spot channels and CMYK channels.
Is this feasible?
Reply With Quote top
  #24  
Old 02-17-2016, 10:01 AM
mantra's Avatar
mantra mantra is offline
Senior Member
 
Join Date: Apr 2010
Location: Rome
Posts: 285
Re: A way to delete all alpha channels at once?

Quote:
Originally Posted by HubertPLPoznan View Post
Hello, I need to have a script that removes only the all Alpha channels.
The script has to leave the all spot channels and CMYK channels.
Is this feasible?
hi
i have this ,it's slow ,but should work
i have stored here c:\Program Files\Adobe\Adobe Photoshop CC 2015\Presets\Scripts\
let tell me if it works , or have you found something better

Code:
function deleteAlphaAndSpotChannels(){
     function isAlphaOrSpotChannel(){
     var ref = new ActionReference();
     ref.putEnumerated( charIDToTypeID("Chnl"), charIDToTypeID("Ordn"), charIDToTypeID("Trgt") ); 
     return executeActionGet(ref).hasKey( stringIDToTypeID('ID') );
     }
     function deleteChannelByIndex( idx ){
          var desc = new ActionDescriptor();
               var ref = new ActionReference();
               ref.putIndex(charIDToTypeID( "Chnl" ), idx )
          desc.putReference( charIDToTypeID( "null" ), ref );
          executeAction( charIDToTypeID( "Dlt " ), desc, DialogModes.NO );
     }
     function getNumberOfChannels(){     
          var ref = new ActionReference();
          ref.putEnumerated( charIDToTypeID("Dcmn"), charIDToTypeID("Ordn"), charIDToTypeID("Trgt") ); 
          return executeActionGet(ref).getInteger( stringIDToTypeID('numberOfChannels'))// does not count layer masks
     }
     function numberOfComponentChannels(){     
          var ref = new ActionReference();
          ref.putEnumerated( charIDToTypeID("Dcmn"), charIDToTypeID("Ordn"), charIDToTypeID("Trgt") ); 
          var mode = typeIDToStringID( executeActionGet( ref ).getEnumerationValue( stringIDToTypeID('mode') ) );
          var numberOfComponentChannels = 4;// set default for CMYK
          switch ( mode ){
               case "RGBColor":
                    numberOfComponentChannels = 3;
                    break;
               case "labColor":
                    numberOfComponentChannels = 3;
                    break;
               case "grayScale":
                    numberOfComponentChannels = 1;
                    break;
          }
          return numberOfComponentChannels;
     }
     while( getNumberOfChannels() > numberOfComponentChannels() ){
          makeChannelActiveByIndex( getNumberOfChannels(), false );
          if( isAlphaOrSpotChannel() ){
               deleteChannelByIndex( getNumberOfChannels() );
          }
     }
     function makeChannelActiveByIndex( idx, visible ){
          var desc = new ActionDescriptor();
               var ref = new ActionReference();
               ref.putIndex(charIDToTypeID( "Chnl" ), idx)
               desc.putReference( charIDToTypeID( "null" ), ref );
               desc.putBoolean( charIDToTypeID( "MkVs" ), visible );
          executeAction( charIDToTypeID( "slct" ), desc, DialogModes.NO );
     }
}
deleteAlphaAndSpotChannels();
Reply With Quote top
  #25  
Old 03-24-2016, 05:32 AM
kankun kankun is offline
Junior Member
 
Join Date: Feb 2012
Posts: 1
Re: A way to delete all alpha channels at once?

god job..i wonder if there's also a way to put all path layers into one?because when i do product retouching like a car retouching.i have to create many paths layers.how can i put them into a single layer at once?
Reply With Quote top
  #26  
Old 03-18-2017, 04:01 PM
geeked geeked is offline
Junior Member
 
Join Date: Mar 2017
Location: nyc
Posts: 2
Re: A way to delete all alpha channels at once?

Not sure if anyone is still here from this thread but I'd love some help. I run actions all the time but have never created a script from scratch as described here and I really wan to create this channel and path killing action! However I can't figure out how to do so in Text Edit on my Mac. It won't let me save a jsx file and even when I overrode it PS wouldn't recognize it. Tried running it through PS as a txt file and those aren't even readable in PS. Help please!!!
Reply With Quote top
  #27  
Old 03-19-2017, 12:23 PM
klev klev is offline
Senior Member
 
Join Date: Jun 2010
Posts: 1,090
Re: A way to delete all alpha channels at once?

Quote:
Originally Posted by geeked View Post
Help please!!!
First off, don't type nonsense like this. It's ridiculous, and it's considered bad forum etiquette. It's also ironic that I typed that last line.

Anyway macs are unix based systems. They don't treat text as anything special or use weird carriage return characters the way Windows does, so that isn't the error. Unix systems don't distinguish between writing text and writing binary files, although there are different encodings. That isn't the problem. It can be safely ruled out.

When you say running it through PS, do you mean loading it from the scripts menu? What script are you running? Paste it inline using the forum's code tags. It looks like a # on the posting menu. I hope it's not the one posted by mantra, because that one is really ugly.
Reply With Quote top
  #28  
Old 03-19-2017, 02:00 PM
geeked geeked is offline
Junior Member
 
Join Date: Mar 2017
Location: nyc
Posts: 2
Re: A way to delete all alpha channels at once?

Seriously, bad etiquette? Don't know what your problem is but luckily I figured out my issue all by myself so won't be needing any of your negativity anyway.

This was my first post on this site and if everyone else is as obnoxious about an innocuous post it'll be my last.

Have a nice day!
Reply With Quote top
  #29  
Old 03-19-2017, 02:37 PM
klev klev is offline
Senior Member
 
Join Date: Jun 2010
Posts: 1,090
Re: A way to delete all alpha channels at once?

Writing things like !!!! makes you a jackass. Don't do it.
Reply With Quote top
Reply

  RetouchPRO > Technique > Photo Retouching


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Misaligning color channels on purpose Peer K Photo Retouching 11 01-21-2010 06:12 AM
Dodging and Burning on Channels? snook305 Photo Retouching 8 04-30-2009 02:13 AM
additional color layer in channels palette? danii Photo Retouching 4 06-27-2008 05:52 AM
I'd like a tutorial on Gradiated (sp?) alpha channels. pixeltickler RP Tutorials 1 12-27-2003 11:28 PM


All times are GMT -6. The time now is 04:05 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
Copyright © 2016 Doug Nelson. All Rights Reserved