How to get current threshold on an adjustment layer

I'm working on the conversion of a large number of documents to bitmap.  I wrote a JavaScript script that will open a file and create a threshold adjustment layer which the user can then adjust at an appropriate level to make the text readable.  The file is then flattened, saved, closed and the following one is open and another threshold adjustment layer is created.  I would have my JavaScript read the threshold level of the current image (an integer 1-255) adjustment layer and then use this threshold when you create the adjustment layer for the next image.  My problem is that I don't know how to access the level of current threshold of my adjustment layer.  I looked through all the properties of ArtLayers in the JavaScript reference pdf file and I can't find one that will give me the information I need.  Can someone help me find this info?

// CS3 or higher
// may not run in ESTK 3.5(CS5) but does run in Photoshop CS5

function readInteger(str, pointer) { //aka signed word = 2 bytes in big-endian byte order
     var b1 = str.charCodeAt(pointer);
        var b2 = str.charCodeAt(pointer + 1);
     var ss = (b1 << 8) + b2;
     if (ss > 0x7FFF) {
          ss = 0xFFFF0000 ^ ss;
     }
     return ss;
}
function getThresholdAdjustmentLayerSettting() {
     var ref = new ActionReference();
     ref.putEnumerated(charIDToTypeID("Lyr "), charIDToTypeID("Ordn"), charIDToTypeID("Trgt"));
     var desc = executeActionGet(ref).getList(stringIDToTypeID('adjustment')).getObjectValue(0);
     var rawData = desc.getData(stringIDToTypeID('legacyContentData'));
     return readInteger(rawData, 0);
}

alert(getThresholdAdjustmentLayerSettting());

Tags: Photoshop

Similar Questions

  • How to get currently displayed a phone app phone number?

    City previous forums:

    nkarasev

    Messages: 93
    Join date: Apr, 2007

    How to get currently displayed a phone app phone number?
    Posted the: July 31, 2008 12:06 AM
     
    If there is a way to get the phone number of the user currently entered the dial phone app BEFORE?

    I know I can get the phone number of the phone call from the newspapers.

    Thank you
    Nikolai

    You can add an ApplicationMenuItem to the phone application which can happen in its run method.  Please note that there is a problem in the 4.3.0 release where this does not (null is passed instead).

    The problem of null is passed by an ApplicationMenuItem in the phone app is solved in BlackBerry handheld software version 4.5.0.  This issue was present in version 4.3.0.

    You see this in newer versions?

  • How to get current Login user in Oracle Forms?

    Hi friends...

    How to get current Login user in Oracle Forms?

    using the PL/SQL Editor on triggers.

    Please tell me...

    You have plsql function USER.

    For example:

    CURRENT_USER: = USER;

    Concerning

  • How to get current user profile on demand connection.

    Hi, guys

    I have a question.

    Currently, we have used the java portlet weblogic, my question is how to get the user profile currently.

    Like this:
    @RequestMapping
    public String listEventLogsList (RenderRequest request, response, model ModelMap RenderResponse) {}
    ....
    Download the profile of the user of the application.
    }

    is a tool util class can hep complete us this work.

    Thank you.

    Hello
    Use getUserPrincipal () .getName () (assuming always connected otherwise that you must check for null)
    ProfileWrapper pw = ProfileFactory.getProfile (userName, null);

    Theres also a way to get the HttpServletRequest to the rendering application, google, even if I do not remember the hand, then you can use the methods of accepting the request

    concerning
    Deepak

  • How to get the background color of a layer with AE SDK

    Hello

    I try to get the background color for my current layer, but I can't seem to find how do.

    I don't want background color, background color of the application, but the color that shows through, if I set the alpha of my pixels to 0.

    For example, assume that the background of the composition is black, I put a solid top, green then put a picture on top of the solid and apply my pug-in the image.

    If I set the alpha to zero in my plug-in, green solid will be displayed.

    So I want to be able to know that my background is green.

    I tried to use PF_AppGetBgColor(), but which returns the background color of the application, which isn't green in this example.

    If you want more details on what I want to do, I plug P1 which affects some 0-alpha pixels. Above it, I apply an another plugin P2 which reveals alpha-0 pixels by mixing with little color.

    What is happening now is that the output is color of the original image, mixed with the color of P2 (because only modified P1 alpha pixels).

    What I want is to have the color through the transparent pixels of P1 display mixed with the color of P2.

    To do this, I would like to be able to set the color of pixels 0-alpha in the color of the background in P1.

    Sorry for the question long.

    Thanks for your suggestions.

    Hello nicolas.

    If I understand it, that you try to get the buffer of image layers composited under the layer with your effect.

    If that is correct, then I fear that it is almost impossible to do.

    When AE makes a composition he doesn't it down. He's trying to do the opposite in fact.

    Why? because if at some point, the buffer is completely opaque, then he has no need to make what's below.

    further more, checked the diaper changing the rendering order, and many other things affect the rendering of the layers order.

    In addition, there is no API to access buffers intermediaries comp. just the end result.

    the closest you can get than without turning of the world, is to use AEGP_GetCompBGColor().

    that would be useless to you that the image is not composite on that color, unless it is the model being saved to the file.

    so why I said 'almost impossible '?

    You can transform the world.

    You can write a type ECAP 'craftsman '. (look at the example of 'arti')

    These plug-ins make comps (instead of the "advanced3D" converter)

    a craftsman has results intermediaries comp, because he is the one doing the rendering.

    so now you can have your craftsman save the buffer, you need and deliver it to your effect.

    I must warn you that this is very very very difficult.

    Another possible solution is to create a copy of the model resides in your effect,

    erase all the layers that has the image you need and make that reproduces model using AEGP_GetReceiptWorld().

    If you use this method, you must supervise the original model and apply changes to the copy.

    Yes, it's too difficult to do.

    you could make a change in the strategy and apply your effect to an adjustment layer instead.

    the entry for the adjustment layer is the buffer underlying layers.

    Then, you could get the original sources you want to treat using checked layer params.

    the last solution I can think uses the expression of sampleImage() on a hidden parameter.

    This will give you any layer's pixel data in the model, but not the composite of the underlying layers.

    Maybe if you tried sampling adjustment layers post effects... I don't know. you need to try.

    This method is very slow and is also limited to expire, so you can't get a large number of pixels.

    the expression simply fails.

    I hope that this was not all bad news for you.

    Maybe you said more about the plug-in you develop I could come up with a better plan.

    :-)

  • How to get a second image in the layer panel

    In item 13, I have two images that I want from. I brought here them both of the Organizer to the editor, but I can't seem to get them both in the layer panel to use one as a background. Someone just tell me how to get an image from the photo bin toward the layer panel?

    ligian2505 wrote:

    In item 13, I have two images that I want from. I brought here them both of the Organizer to the editor, but I can't seem to get them both in the layer panel to use one as a background. Someone just tell me how to get an image from the photo bin toward the layer panel?

    Several solutions. I advise to begin:

    You have your two visible photos the of in "basket" (area of the bottom of the screen). Choose the one that will serve as "background by double clicking on its icon. She apparaiit in the editing space. Now, click the second image basket of the in and drag on the edit box.  You have a preview of this new layer, ready to be resized, moved or such. Use the handles of the frame of this image pour what control do. When you post by clicking the green check mark, your new layer should appear in the layers of the screen Panel.

    You can adjust the dimensions etc. without loss of quality; This layer is UN 'smart object' as long as you don't choose "simplifier" (freeze) the layer which becomes a regular layer.

    Some operations on the layers cannot be carried out only after having simplified.

  • How do Control M to create an adjustment layer curves?

    M control creates a default curves adjustment.  However, there is a way to get control M to create a curves adjustment layer.  I forgot how to do this!

    Go to Edition > shortcuts keyboard and change the Ctrl + M to layer > new adjustment layer > curves.

  • How do multiple operations on a single adjustment layer?

    How did I can do two or more operations on a single adjustment layer - i.e. change of brightness hue without having to make two layers and it is why two masks?

    I put the adjustment layers in a group and attach a mask to the group.

  • How to get the content of the shape layer settings in the CEAP?

    Hi all

    I don't know when I want to export the settings from the contents of the shape layer.

    Now I add Polystar Path1, zig - zag 1 and Repeater1, three material layer shaper.

    Content does not seem to be equal to effect. I used AEGP_GetNewEffectStreamByIndex can get the parameter of the effect of the shape layer. But none of the content information.

    Does anyone know how to get this content settings?

    Thank you.

    ha ha, silly me.

    I missed your intention completely.

    It's actually very simple.

    It was recently discussed here:

    http://forums.Adobe.com/thread/741968?TSTART=0

    I hope I got it this time.

    :-)

  • How to get the value of the gradient layer properties?

    Hi all

    I want to get the properties of the gradient layer such as its name, the value of the color and mode?

    The properties also like angle, style and scale that appears in the Panel of gradient fill, when we create the gradient layer?

    Thank you

    There are many parameters of a layer of setting gradientFill. I think that there are always at least two stages of color (even if they are the same color). And I'm not sure what you mean by 'mode '.

    Here's a way to get the layer settings.

    function getGradientFillAdjustmentInfo(){
        if(app.documents.length==0 || app.activeDocument.activeLayer.kind != LayerKind.GRADIENTFILL ) return;
        var gradientInfo = {};
        gradientInfo.toString = function(){return "GradientInfo";}
        var ref = new ActionReference();
        ref.putEnumerated( charIDToTypeID("Lyr "), charIDToTypeID("Ordn"), charIDToTypeID("Trgt") );
        var desc = executeActionGet(ref).getList(charIDToTypeID("Adjs")).getObjectValue(0);
        if(desc.hasKey(charIDToTypeID("Dthr"))) gradientInfo.dither = desc.getBoolean(charIDToTypeID("Dthr"));
        if(desc.hasKey(charIDToTypeID("Rvrs"))) gradientInfo.reverse = desc.getBoolean(charIDToTypeID("Rvrs"));
        if(desc.hasKey(charIDToTypeID("Angl"))) gradientInfo.angle = desc.getDouble(charIDToTypeID("Angl"));
        if(desc.hasKey(charIDToTypeID("Type"))) gradientInfo.type = typeIDToStringID(desc.getEnumerationValue(charIDToTypeID("Type")));
        if(desc.hasKey(charIDToTypeID("Scl "))) gradientInfo.scale = desc.getDouble(charIDToTypeID("Scl "));
        if(desc.hasKey(charIDToTypeID("Ofst"))){
                    gradientInfo.offset = [desc.getObjectValue(charIDToTypeID("Ofst")).getUnitDoubleValue(charIDToTypeID("Hrzn")),
                                                    desc.getObjectValue(charIDToTypeID("Ofst")).getUnitDoubleValue(charIDToTypeID("Vrtc"))];
        }
        desc = desc.getObjectValue(charIDToTypeID("Grad"));
        gradientInfo.name = desc.getString(charIDToTypeID("Nm  "));
        gradientInfo.gradientForm = typeIDToStringID(desc.getEnumerationValue(charIDToTypeID("GrdF")));
        var colorList = desc.getList(charIDToTypeID("Clrs"));
        var transList = desc.getList(charIDToTypeID("Trns"));
        gradientInfo.numberOfColorStops = colorList.count;
        gradientInfo.colorStops = [];
        for(var colorIndex=0;colorIndex		   
  • How to blur the edges of one adjustment layer (whose job it is to fade thereafter an image)?

    I'm trying so to create a kind of breath of rocket that distorts the background behind her like a heat wave, but the explosion of particles, made separately from the physical rocket and the background needs to be blurred first, before he can act as a mask for the effect. Can anyone help with this. Keep in mind that I am COMPLETELY new to the software. This is literally my first project never use, so I would appreciate if the answers were extensive and well explained step by step. Thank you.

    Using the pen tool - the Ellipse or Rectangle tools, for that matter - to create a mask on the adjustment layer.  Open properties of the adjustment layer mask, adjust the feather to satisfy all tastes.

    And if it's not enough basic for you, you do not have any business AE running.

  • How to get a RAW image not adjusted EPS

    How do you get a picture no adjusted Adobe Camera Raw in Photoshop Elements?  When I open a RAW file in ACR, the image is slightly different from the RAW (.nef) image as seen in other viewers the image.  I believe that the difference may be due to default settings in ACR.  What parameters corresponding to no adjustment at all?

    The default settings or in the context menu where it says

    Camera Raw default is closest to an unadjusted raw file

    This camera raw provides. The default settings can be changed,

    so, you might want to click on the shortcut menu and choose Reset Camera Raw default.

    Other spectators as decision-makers in the camera software, can bring up the different file

    because he can read the settings from the camera this camera raw reads no and some

    viewers aren't really color management.

    The idea of camera raw adobe is really to make the raw file resemble

    you want through the use of various adjustments in camera raw.

    MTSTUNER

  • How to get current USB in Labview

    Using the Windows Device Manager and selecting the USB HUB, you are able to see the current consumption of your USB devices.

    See attached picture.

    Is it possible to get this value programmatically using Windows DLL calls in Labview or Labview property?

    Thank you

    You can see what the unit is ESTIMATED to consume.  This is not a value of actual consumption.

    It is possible to achieve this programmatically, but I doubt it will give you the information you are looking for...

  • How to get back to changes in adjustment brush?

    I use LR 4.2 and I have a question about non-destructive Editor, specifically the use of the adjustment brushes.  After that I work with an adjustment brush and then continue with my editing that I can't figure out how to make the settings for which was darn earlier on the adjustment brush area.  With all the other editing features, I can change something, and then later make a change.  For example, I can put 10 highlights and then later I can change bulleted highlights-15 and then later change it to something else.  With things, I did with brushes of adjustment well that I did not understand the technique to do.  If I select adjustment and then brush click the box that I had changed earlier with an adjustment brush, apparently not reselect this area so that I can tweak it.  Is there a way to go back and change the fields selected with an adjustment brush?

    Yes, you can change the parameters of the adjustment brush after the fact by opening the adjustment once Brush tool again and selecting the PIN for the mask you want to adjust. The PIN will then have a black dot in the middle and adjustments for this mask will be in th cursor Panel, you go!

  • How to get current utc date time in oracle

    Hello

    SYSDATE shows date current time in the time zone based on SessionTimeZone. Is there a built in function or in some other way to get the current utc date time without changing the value of the SessionTimeZone.

    Thank you
    YG

    Or

    SELECT SYS_EXTRACT_UTC(SYSTIMESTAMP)UTC_SYS, SYSTIMESTAMP FROM DUAL; 
    

    * 009 *.

Maybe you are looking for