Draw line between black pixel : coordinates of selected pixels ?

Hi
I want to build a script which can check a Photoshop file and :
- find black pixel
- for each black pixel, look for another black pixel within maximum distance of 5 pixels
- then draw a line between the two black pixels.
I wrote this script below (my first script ...), but it's VERY slow (and my final image is VERY big), I think because I test the colour for each pixel of the image.
So another solution would be to first select black pixel with magic wand, then the script save all coordinates of selected pixels, then my script wil test only this pixels (less than 1% of the pixels are black in my image).
Is it possible with JavaScript ?
Thank you for your response !
Marc
function main(){
var startRulerUnits = app.preferences.rulerUnits;
app.preferences.rulerUnits = Units.PIXELS;
var myHeight = app.activeDocument.height;
var myWidth = app.activeDocument.width;
// Find black pixel
for(var i=5; i<myWidth; i++) {
  for(var j=5; j<myHeight; j++) {
   activeDocument.colorSamplers.removeAll()
   var sampler = activeDocument.colorSamplers.add([new UnitValue (i, 'px'), new UnitValue (j, 'px')]);
   if (sampler.color.rgb.hexValue === "000000") {
// For each black pixel, search another black pixel below left up to 5 pixels
    for (var m=i-5; m<i; m++) {
     for (var n=j+1; n<j+5; n++) {
      activeDocument.colorSamplers.removeAll()
      var test = activeDocument.colorSamplers.add([new UnitValue (m, 'px'), new UnitValue (n, 'px')]);
      if (test.color.rgb.hexValue === "000000") {
// Then draw a black line between the two black pixels
       var FillColour = new SolidColor;
       FillColour.rgb.hexValue = '000000';
       var ad=activeDocument;
       ad.selection.select([[m,n],[i,j],[m,n+1],[i,j+1]], SelectionType.REPLACE, 0, true);
       ad.selection.fill(FillColour);
       ad.selection.deselect()
// For each black pixel, search another black pixel below right up to 5 pixels
     for (var m=i+1; m<i+5; m++) {
      for (var n=j; n<j+5; n++) {
       activeDocument.colorSamplers.removeAll()
       var test = activeDocument.colorSamplers.add([new UnitValue (m, 'px'), new UnitValue (n, 'px')]);
       if (test.color.rgb.hexValue === "000000") {
// Then draw a black line between the two black pixels
        var FillColour = new SolidColor;
        FillColour.rgb.hexValue = '000000';
        var ad=activeDocument;
        ad.selection.select([[i,j],[m,n],[m,n+1],[i,j+1]], SelectionType.REPLACE, 0, true);
        ad.selection.fill(FillColour);
        ad.selection.deselect()
main();

The first alert should have shown the first pathPoint.anchors for all the subPaths in the path.
The xyArray is just something I added for the alerts. The array 'myPathInfo' should have all the info extracted from the path.
myPathInfo.length will tell you how many subPaths are in the Path.
myPathInfo[index].entireSubPath.length will tell you how many pathPoints are in that subPath
myPathInfo[index].entireSubPath[index].anchor will tell you the position of that pathPoint.
The indexes start with zero.
The bounding box of the entire subPath can be hard to work out just from the pathPoints. Unless all the point are corner points the path may extend beyond the anchors. One think you can do is create a new path from just one of the subPaths, convert by to a selection, and then get the bounds from the selection. You can make a new path from a subPath using the 'myPathInfo' array from above.
app.activeDocument.pathItems.add("myPath1", [myPathInfo[0]]);
That line will make a new path from the first subPath. Change the index to use a different subPath.
Some other info that may help.
app.activeDocument.histogram[0] will tell you how may black pixels are in the document. But its no help determining where they are. If that returns 0 there are no black pixels.
If you don't have any luck working with converting the original color range selection into a path and need to go back to searching with the colorSampler it may help to use a grid approach. For example make a square selection, the size depending on how scattered the black pixels are, say 25x25px. Then use color range to select black. With an active selection it will only select pixels in that selected area( if any). You could then check to see if there is a selection. If not make another same size square to the right edge of the last area. If there is a selection, the solid property will tell you if more than one black pixel was selected( unless they are right next to each other ). If solid == true the selection bounds will tell you where the pixel is. If false you have to then search that square. But if there are areas where there are no black pixels checking a square range of pixels at once should be quite a bit faster than checking every pixel. And checking the historgram first will let you know if you should bother searching to start with.

Similar Messages

  • Draw line or a dot for a specific pixels on the image

    Hi all,
    I have an 8bit grayscale image, i have extracted the column indeces of Image which has defects. I need to mark the defective pixels with a line or dot indication on the image. Can anybody suggest me how to go about it.
    Regards,
    KM
    Solved!
    Go to Solution.

    Hi falkpl,
    Thanks for your  time, the overlay is working fine, i passed a 1D array of constant pixels (i.e 250)(Y Coordinates)
    Here is my actual requirement:
    I am having a Grayscale 8-bit image (3969 X 600)(To find the pixel values widthwise which has defects, X-Coordinates).
    I perform sum of column pixels to get a 1d array.
    I get the average (average= sum/size of 1d array)
    I find the pixel values above average.
    Finally i extraxt the Non-zero indeces for the pixel values. 
    I am facing an issue to find the Cooresponding Y-Coordinates(Pixels for height) for the X-coordinates(Pixels for Width). So i can feed the both x & y coordinates to overlay function to mark the exact pixel with defect on the image.
    I would be glad if you suggest me how to find the height pixels for the corresponding width pixels.
    Regards,
    KM
    Attachments:
    Capture.PNG ‏19 KB

  • Horizontal line between rows in List component

    Hi,
    How to draw lines between rows in ListBase components?
    (something like verticalGidLines in DataGrid component).
    I know how to customize mouse-hover and selection boxes in a
    ListBase components,
    example:
    Vista Start
    Menu
    Thanks,
    Mariosh

    I tried the invalidate method as follows but nothing happened:
    mylist.invalidate();
    Not sure if I explained myself well, I just want the horizontal scrollbar to appear and be able to move it when one or more items in the list are long and thus not all visible...thanks

  • Draw line in xy graph(pict​ure)

    Hi all,
    I import a picture into xy graph than i enable to annotate some indicators.
    after i put the indicator in some location in xy graph(picture) i want to draw lines between the indicators.
    can somebody help me with that? i'm using LABVIEW 8.2.1
    sorry for my english.
    Solved!
    Go to Solution.
    Attachments:
    test1.vi ‏172 KB
    test.jpg ‏14 KB

    Have a look at my example from long ago.
    Here;s a quick and diry draft modification of your VI, see if it works for you. (lines are drawn between annotations when OK is pressed).
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    test1MOD.zip ‏43 KB

  • Scatter chart with lines between points

    In one of our Deski reports, we have a "funnel" chart.  This is essentially achieved with a scatter plot graph with lines drawn between the scatter points to resemble a line chart.  This allows us to draw odd lines, such as a funnels that don't really look like funnels.    (Picture drawing a concentric circle for another visualization of what we are trying to accomplish).  So our problem is that we need to convert this Deski Report to Webi in order to move to BusinessObjects 4.1.  But we cannot seem to achieve this in Webi because the scatter plot in Webi does not draw lines between the points.  Any ideas out there?  Can this be done in a current BusinessObjects tool?

    Hi,
    We have the same problem, did you solve your problem and how?
    thanks in advanced

  • Question about VBox/HBox and drawing things between things like a Mind Map

    Hi people!
    I'm toying with some techniques to draw something like a mind map using JavaFX. The idea was to make one HBox with two elements, left is the content node and the right element is a VBox with the child nodes.
    The problem is drawing lines between the left node and the child nodes.
    I suspect the double binding might be a problem in the lines definition, or perhaps that VBox/HBox don't actually change the x,y for the children, but rather translate them.
    Here's a working buggy example:
    package tree;
    import javafx.scene.CustomNode;
    import javafx.scene.Group;
    import javafx.scene.input.MouseEvent;
    import javafx.scene.layout.HBox;
    import javafx.scene.layout.VBox;
    import javafx.scene.Node;
    import javafx.scene.paint.Color;
    import javafx.scene.Scene;
    import javafx.scene.shape.Line;
    import javafx.scene.shape.Rectangle;
    import javafx.stage.Stage;
    public class MyNode extends CustomNode {
        var children : MyNode[] = [];
        def rect = Rectangle {
            width: 20
            height: 20
            fill: Color.RED
            onMouseClicked: function( e: MouseEvent ) {
                insert MyNode { } into children;
        public def leftConnectorX = bind rect.x;
        public def leftConnectorY = bind rect.y + rect.height / 2;
        public def rightConnectorX = bind rect.x + rect.width;
        public def rightConnectorY = bind rect.y + rect.height / 2;
        // A vertical layout box of the child nodes
        def childs = VBox {
            spacing: 5
            content: bind children };
        // These are the lines between this node and its direct children
        def lines = bind for(child in children) Line {
            startX: bind rightConnectorX
            startY: bind rightConnectorY
            endX: bind child.leftConnectorX
            endY: bind child.leftConnectorY
        override function create():Node {
            return Group {
                content: bind [
                    lines,
                    HBox {
                        spacing: 15
                        content: [ rect, childs ]
    function run(args : String[]) {
        return Stage {
            title: "Tree of trees"
            width: 800
            height: 600
            scene: Scene {
                content: MyNode {
    }Any ideas why the lines aren't drawn? Or any idea of a better way to achieve mind mapping-ish tree?

    I'm sure there will be some updates soon to fix those small problems. I mean, how hard can it be? ;-)
    I got my code working, had to move the lines to outside the nested HBox/VBox'es to be able to positioning them freely.
    package tree2;
    import javafx.scene.CustomNode;
    import javafx.scene.Group;
    import javafx.scene.input.MouseEvent;
    import javafx.scene.layout.HBox;
    import javafx.scene.layout.VBox;
    import javafx.scene.Node;
    import javafx.scene.paint.Color;
    import javafx.scene.Scene;
    import javafx.scene.shape.Line;
    import javafx.scene.shape.Rectangle;
    import javafx.stage.Stage;
    public class MyNode extends CustomNode {
        var children : MyNode[] = [];
        def rect = Rectangle {
            width: 20
            height: 20
            fill: Color.RED
            onMouseClicked: function( e: MouseEvent ) {
                insert MyNode { } into children;
        public def leftConnectorX = bind rect.boundsInScene.minX;
        public def leftConnectorY = bind rect.boundsInScene.minY + rect.height / 2;
        public def rightConnectorX = bind rect.boundsInScene.minX + rect.width;
        public def rightConnectorY = bind rect.boundsInScene.minY + rect.height / 2;
        // A vertical layout box of the child nodes
        def childs = VBox {
            spacing: 5
            content: bind children };
        // These are the lines between this node and its direct children
        public def lines : Line[] = bind
        for(child in children) [
            child.lines,
            Line {
                startX: bind rightConnectorX
                startY: bind rightConnectorY
                endX: bind child.leftConnectorX
                endY: bind child.leftConnectorY
        override function create():Node {
            return Group {
                content: bind
                    HBox {
                        spacing: 15
                        content: [ rect, childs ]
    function run(args : String[]) {
    def node = MyNode {};
    return Stage {
        title: "Tree of trees"
        width: 800
        height: 600
        scene: Scene {
            content: Group {
                content: bind [ node, node.lines ]
    }

  • Pixel coordinate​s along a ROI (line)

    Hi
    Problem: Calculating distance using "distance formula" for all the pixel points along a line on an image.
    I am grabbing images using a camera and then using "ROI line.vi" , to define a line as region of interest.For that I have to provide,initial and final coordinates of the line (pixels) , then I use ROI transform.vi to rotate this line about a point which is one of the ends of the line.This way I get a new line (ROI) and using "ROI to line" I get the pixel coordinates of two ends for the rotated line.
    Now I want to get the distance between two points on a line and for that I need the pixel cooridinates for the whole line.Does someone know how to get this ? or is there any better way of doing this?
    And yah I am using 100 pixels = 34.29 mm to convert pixel distance into mm.Is it correct ?
    Is it possible to switch on and off a bulb/electrical appliance using lab view ? Just want to try this out for fun ....
    Thanks a lot !
    Deepak
    LAB View 2010 SP1

    Hey Deepak,
    To answer your questions, I am assuming that you have the Vision Development Module installed, especially if you are using some of the Vision functions already (that you mentioned). Now, what I understand of what you are trying to do, it sounds like you already have the two endpoints of the line, and you want to get the pixel points in between to be able to make measurements on those. So if you already have the two end points of the line, then I would recommend you check out the following functions: IMAQ LineProfile.VI or IMAQ GetPixelLine.VI. The help documentation on these two will tell you more details about them, but basically you can get the values of the pixels on a line. Then once you have the other points and their values, you can do either use the IMAQ Caliper functions to measure distances on the line, or perform your own calculations using simple LabVIEW functions (like add, subtract, divide, etc.).
    You also mentioned something about converting pixel values to real world values. You can use the Calibration VI's in order to calibrate your image, and also use some of the other functions like IMAQ Convert Pixel to Real World.VI. If you don't want to use the Calibration functions, then you can perform your own conversion, again using simple LabVIEW functions.
    Last, for your question about switching on/off a light bulb or some other electrical appliance using LabVIEW, I would have to mention that LabVIEW can control electrical components, but usually with the help of some kind of hardware. Some hardware that I could think of would be some kind of electrical switch hooked up to a DAQ (data acquisition) board that can do either digital or analog output. Another option would be to use some 3rd party hardware and communicate with LabVIEW via some kind of protocol, such as serial, TCP/IP, modbus, Datasocket, etc. etc.There are numerous ways you can go about having LabVIEW control things via hardware.
    I hope these answers help. Please let me know if you need any clarification on anything. Thanks, and have a great day.
    Regards,
    DJ L.

  • Suggestion to draw a line between two points...

    I have the XYZ position of 2 points, I would like to draw a line between those points. I have tried with a cylinder and it did not work as I expect...I guess a better method exist in Java3D... Do you have any suggestions??
    thanks
    Pete

    try the LineArray class.

  • Draw an animated line between points

    I'm looking to develop an application that will draw an
    animated line between points. Some of the points will be
    pre-defined, and others will be set based on input from the user.
    I'm new to flash and/or any related products, so I'm just
    looking for some general directions on where to begin. What I'm
    wondering is
    a) what product or products would I use to put together such
    an application, and
    b) is this a complicated/difficutl thing or something fairly
    strightforward
    Thanks for any help!

    Hello BrotherBob
    Thanks for you rquick reply.
    I've checked those settings and the Brush Dynamics were off, on all brushed.
    Also, wet edges, airbrush and smoothing are 'greyed out' and appear to be locked.
    Still the same effect, the square brush works, the round brushes don't!

  • How draw a line between two buttons?

    Hi.
    I want to make two movable buttons connected  with a line. When changing position of any button you'll change look of  the line of course.  I know how to draw a line but after MOUSE_DOWN, and  I don't know how to remove an old one line, and how make this line to  be shown all the time?
    My code
    btn2.addEventListener(MouseEvent.MOUSE_DOWN,
    mouseDownHandler3);
    btn2.addEventListener(MouseEvent.MOUSE_UP, mouseUpHandler3);
    btn3.addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler3);
    btn3.addEventListener(MouseEvent.MOUSE_UP, mouseUpHandler3);
    // Define a mouse down handler (user is dragging)
    function mouseDownHandler3(evt:MouseEvent):void {
       var object = evt.target;
       // we should limit dragging to the area inside the canvas
       object.startDrag();
    function mouseUpHandler3(evt:MouseEvent):void {
       var obj = evt.target;
          obj.stopDrag();
          //spisujemy x,y
          var x2Pos:Number = btn2.x;
          var y2Pos:Number = btn2.y;
          var x3Pos:Number = btn3.x;
          var y3Pos:Number = btn3.y;
          trace (x3Pos);
          trace (y3Pos);
          var roundObject:Shape = new Shape();
          roundObject.graphics.lineStyle(2, 0x990000, .75);
          roundObject.graphics.moveTo(x2Pos, y2Pos);
          roundObject.graphics.lineTo(x3Pos, y3Pos);
          this.addChild(roundObject);
          //this.removeChild(this.getChildAt(this.numChildren -1));
    Source .FLA: http://www.mediafire.com/?y2tyzz4zxun

    Here's a solution that you can adapt for two or more buttons....
    var btns:Array = [btn2, btn3]; //instances on stage
    //set btn handlers
    function setBtns():void {
          for(var i=0; i<btns.length; i++) {
                btns[i].buttonMode = true;
                btns[i].addEventListener(MouseEvent.MOUSE_DOWN, grab);
                btns[i].addEventListener(MouseEvent.MOUSE_UP, drop);
    setBtns();
    //draws lines btween all btns while a drag is occurring
    function drawLines(e:Event=null):void {
          graphics.clear();
          graphics.lineStyle(2, 0xFF0000);
          graphics.moveTo(btns[0].x+(btns[0].width/2), btns[0].y+(btns[0].height/2));
          for(var j=btns.length-1; j>=1; j--) {
                graphics.lineTo(btns[j].x+(btns[j].width/2), btns[j].y+(btns[j].height/2));
    //handlers
    function grab(event:MouseEvent):void {
          event.target.startDrag();
          addEventListener(Event.ENTER_FRAME, drawLines);
    function drop(event:MouseEvent):void {
        event.target.stopDrag();
        removeEventListener(Event.ENTER_FRAME, drawLines);
    drawLines();

  • Thin white line between line art and live paint fill?

    I am using live paint to paint cartoon character illustrations.  The artwork is brought into Illustrator CS3 and live traced.  Then I convert it to a live paint group and use the paint bucket to fill.  Everything looks fine no matter how much I zoom in.  If I bring the AI file into Photoshop CS6 I can see a thin white line between the black line art and the fill.  This is most noticeable where black meets black. I can also see this sometimes in file previews while browsing through files.  If the white line cannot be seen in Illustrator is the file ok?  I did just upgrade to CS6 if that would make a difference.
    Thank you for any help.    

    If the white line cannot be seen in Illustrator is the file ok?
    Without knowing specifics,nobody knows.
    "Okay" for what?
    If it looks okay to you in Illustrator, then it's okay for viewing in Illustrator.
    If the export of it does not look okay in Photoshop at 1:1 or higher zoom, then it's probably not okay for whatever you're going to do with that raster image.
    If it's printed to a low-res composite printer, then it may be okay, because the printer may not be able to resolve the whitish pixels.
    If it's printed for commercial (color-separated) reproduction, it may not be okay, depending on the scale at which it will be printed, and on other considerations partially described below.
    The autotrace routine does not build traps. Typically, when you color-fill cartoon line art manually, you don't make the shapes that define the fills merely "kiss" the black line work, as would the default treatments of a stupid autotrace. The black line work typically overprints the fills, thereby creating printing traps.
    Suppose a portion of your cartoon is a hand-drawn closed circle. The black line work is irregular; it varies in width, having been drawn with a marker or a brush. The circle is colored in with a medium green. There are no sloppy gaps in the original between the green and the black.
    You scan it and autotrace it. Unless you apply some deliberate care to make it do otherwise, the autotrace is going to create a compound path, filled with black, and with no stroke; and a green simple path which (hopefully) exactly "kisses" (abuts) the black path. Adobe's on-screen antialiasing of the edge where the two colors abut may or may not cause your monitor to display a faint whitish or grayish sliver between the two colors.
    Similarly, Photoshop's rasterization of it, or the rasterization of a raster export filter may do the same, and may actually result in some off-color pixels along the edge. (Your description of the scenario kinda raises the question of why you are auto-tracing something that you're then just going to rasterize in Photoshop anyway. Why do that? Why not just work with the scan in Photoshop?.)
    So let's leave Photoshop out of the picture and assume you are autotracing it because you want vector artwork. You zoom way in to see if the whitish sliver enlarges. It doesn't, so you assume it's just an aberation of Illustrator's on-screen antialising. And then someone tells you you're in the clear. But are you? Not so fast.
    Let's assume the artwork is destined for commercial (color-separated) printing. Further assume the color of the autotraced black is 100% K, and the color of the autotraced green is 100Y 50C. Three inks involved. None of those three inks are shared between the two objects. So even if the paths do, in fact, perfectly abut, there is no "wiggle room" built in for the minor alignment shifts that almost aways do occur on press.
    Bottom line: Even if you do determine that the common antialiasing aberations that frequently occur on-screen in Adobe apps is just that—just an onscreen aberation, that does not necessarily mean your file is suitable for commercial color-separated reproduction.
    First, you need to understand that autotracing is not the one-click, instant "conversion" of a raster image to vector artwork that far too many think it to be. Just like everything else, you don't just launch a program like Illustrator, start autotracing things willy-nilly without understanding what's really going on. Just like anyting else, you can use an autotrace feature intelligently or...well...not.
    You have options. Illustrator provides an auto-trapping feature. Read up on it in the documentation so you understand what it's all about. Alternatively, you can expand the results of your autotrace, select all the black linework and apply a composite color that includes 100% K and reasonable percentages of C, M, and Y (a so-called "rich black"). Or,depending on the artwork and the desired results, you may consider doing the autotrace as centerlines so you have stroked paths, not just filled paths for the linework. That way, using the flood fill (so called LivePaint) will cause the auto-created fill objects to extend to the paths, not just to the edges of their strokes. Then set the linework to overprint.
    At any rate, if you are doing this professionally, you need to read up on the principles and practices of trapping and color separation.
    JET

  • Line weight changes when using Align to Pixel grid

    When I select Align to Pixel Grid in the Transform Panel, I see line weight changes occur. I try to change the line weight in the either the Stroke or Appearance panel and it will not change, no layers locked, any ideas how to change the line weight?

    Chouettecacahuete wrote:
    ... I noticed that the line increases from 0.5pt to 1pt mainly (although not always) on straight lines, anything with a bezier curve seems to remain as 0.5pt.
    Just try this, with snap to pixel grid on, create 10 pixel long straight horizontal 1pt line with the pen or line tool. You won't be able to change the stroke weight to other than whole numbers. But if you rotate the line with only 0.01 degrees by typing this for rotation in the Transform panel, then you can change the stroke weight to 1.25 for example. When creating artworks for for screen display always verify the result with View > Pixel Preview turned on.
    tonyharmer wrote:
    ...I only referred to Photoshop to illustrate the behaviour - vector tools aside, everything you do in Photoshop has to be whole pixels
    As I said, Photoshop doesn't have  snap to pixel grid feature like Illustrator. You can easily create fuzzy lines in Photoshop if you are not drawing them precisely in the middle of the pixels. To check what I'm talking about try this In Photoshop, create a new document with a very small pixel dimensions like 20 x 20 pixels and zoom to the maximum 3200% to see clearly the result. Fill the image with light gray color so you can see the pixels when View > Show Pixel grid is on. Then with black color try drawing a straight line with any tool that creates pixels like a hard brush or the line tool used in pixel mode, and try using constraints like holding Shift while dragging. You will see that unless you draw the lines exactly in the middle of the pixels it will be fuzzy and not clean. The only way to ensure not fuzzy lines in Photoshop is to turn  off the anti-aliasing. You do this by unchecking the anti-alias for tools that have this option and instead of burshes use the pencil tool (which is brush without anti-aliasing). And Illustrator works the same too if you turn off Anti-aliased Artwork in its general section of the preferences and view the result with View > Pixel Preview, you don't need to have the Align to Pixel Grid on, the aliased result will be the same like in Photoshop.

  • Edging problem "thin white line" between paths in Illustrator CS4...

    I am making a map of Europe with Illustrator CS4 for a documentary about WWI and how the Versailles Treaty carved up imperial Germany. After having traced imperial Germany before Versailles, I then carve out the territories given to neighboring states. The problem is these very fine white lines that appear between paths.
    I have two paths right next to each other. But for some reason I see this very thine white line gap that shows up between them and becomes much more evident when I export into Photoshop. Please notice this very fine white line in the black image. What you see in this image are in fact two paths side by side. There should be no line between them. And I have no idea why this very fine line appears but it gets much worse in Photoshop much more noticeable. Please click on image to see the line more clearly.
    Thank you very much in advance for any help or suggestions.
    - Nick

    Dear Jacob and Peter,
    Thank you both very much for your help.
    Please see these photos showing my problem more clearly.
    I am using Illustrator to draw the regions, Photoshop to consolidate the layers, and Apple Motion 4 to build my animation.
    [1] : Imperial Germany in 1914.
    [2] : Germany after Versailles.
    In Illustrator CS4, the images [1] and [2] have the colored layers in "Multiply" transparency mode. It's how I want the layers to look when I import them into Apple Motion 4.
    My idea was to color all the layers black in "Normal" mode and then apply "colorize" filters in Motion 4 and set the transparency to "multiply" in Motion.
    Now with Imperial Germany (all layers colored in black with transparency set to "Normal"), when I bring the image into Photoshop, I suddenly get very fine white lines between the layers and these lines show up in Motion which is the big problem. Like I said, when you click on this last photo, and you see the image full size, you can clearly see the problematic lines which appear exactly where the layers touch each other. In the photo below, the territories ceded to Poland (West Prussia) and Lithuania (Memel) are not yet red. They are still black but you can see the lines.
    I don't understand because in Illustrator there were no gaps whatsoever between the layers. In Illustrator CS4, I simply cut the "territorial losses" from imperial Germany using the "Trim" function in the Pathfinder Menu. I created the red and yellow layers from the original single "imperial Germany" layer. In Illustrator I can colorize all the layers black and still never see any gaps. The fine white lines, appear in Photoshop and in Motion.
    (NOTE: The documentary is being in edited in Final Cut Studio which is why I use Motion for animating.)
    Sorry to ramble on. Thank you again for any further help you can give me.
    - Nick

  • Need to draw line after the 2nd line item(Smart Forms)

    Dear Friends,
    I need to draw horizontal line after the 2nd line item  and 3rd line item in smart forms.How can i achive this.
    Plz help.
    Edited by: farook shaik on May 19, 2009 8:19 AM

    This is what you need to do:
    1> In the tables->details section define two line types LT1 and LT2.
    2> Come back to tables section pressing the table painter button.
    3> Select a line type for which you want to have an underline(say LT2).
         a] If the anchor cursor does not come click the draw lines and columns button( the pencil icon nutton)
         b] select the line type ( it will become black after selection. Press and hold down ctrl to select
             multiple cells.
         c] after selection click the lower 'frame button' ( which is right at the top of box and shading).
    4> Now goto data section where you have given your internal table name and work area.
         a] in the sort criteria put your field POSNR and check the Event on Sort end chk box.
         b] you will see an extra node under the main area of the table.
         c] Create a table line with the line type LT2 in the node.
         d]Also in the Main area add another table line with LT1 as the line type.
    5> If POSNR remains unchnged LT1 will be triggered.
    6> if Posnr changes then LT2 will be triggered with the underline.
    This will suffice your requirement.

  • Polar equation of a line between two points

    I am trying to make a method to output the points (in polar coordinates (r, theta)) along a line between two given polar coordinates.
    This will mimick the path of an object traveling across a radar screen.
    Is this possible?

    Java does not plot in polar coordiantes, you'll have to convert to rectangular to get a plot. If you're just doing a sweep on a screen, then it's fairly simple to do:
    r is the radius of your screen,
    (0,0) is your Origin translated as (Xmax/2, Ymax/2)
    when you draw the line you just start at your Origin and get your end values as
    X1=X0+r*cos(Theta) and
    Y1=Y0+r*sin(Theta),
    I've not seen, nor do I think there is any other support to do what you want--you have to convert to (x,y) coordinate system.
    This will leave a ragged edge so make a border around your screen.
    import java.awt.Color;
    import java.awt.Dimension;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import java.awt.Graphics;
    import java.awt.Graphics2D;
    import java.awt.image.BufferedImage;
    import java.awt.Point;
    import javax.swing.JFrame;
    import javax.swing.JPanel;
    import javax.swing.Timer;
    public class JRadar{
      public JRadar(){
        JPanel p = new MyJPanel();
        JFrame f = new JFrame("ForumJunk: JRadar");
        f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        f.add(p);
        f.pack();
        f.setVisible(true);
      public static void main(String[] args){
        new JRadar();
      class MyJPanel extends JPanel implements ActionListener{
        Timer t = new Timer(10, this);
        Dimension d = new Dimension(512, 512);
        BufferedImage bi = new BufferedImage(d.width, d.height, BufferedImage.TYPE_INT_RGB);
        Graphics2D g = bi.createGraphics();
        double theta = 0;
        int r = d.width/2 - 16;
        Point origin = new Point(d.width/2, d.height/2);
        public MyJPanel(){
          g.setColor(Color.RED);
          this.setPreferredSize(d);
          t.start();
        public void actionPerformed(ActionEvent e){
          g.clearRect(0, 0, d.width, d.height);
          g.drawOval(16, 16, 480, 480);
          g.drawLine(origin.x, origin.y, (int)(origin.x+r*Math.cos(theta)), (int)(origin.y+r*Math.sin(theta)));
          theta += 0.01;
          if(theta>=Math.PI*2) theta = 0.0;
          repaint();
        public void paintComponent(Graphics g){
          super.paintComponent(g);
          g.drawImage(bi, 0, 0, this);
    }Edited by: morgalr on Mar 3, 2010 4:59 PM: code example added

Maybe you are looking for