Method and system for converting fill to stroke in a graphics file

CN123036624APending Publication Date: 2026-11-03ESKO SOFTWARE
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202580023649.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Priority Date
2024-03-24
Filing Date
2025-02-26
Publication Date
2026-11-03

AI Technical Summary

Technical Problem

After converting the stroke path to a fill path, information such as the shape and width of the original stroke features is often lost, making it impossible to effectively use the stroke path as a cutter or automatically identify registration marks.

Method used

By defining the outline of the fill shape, identifying parallel segments and approximating them as straight lines, discarding parallel pairs that do not conform to the line width, connecting the center line and reconstructing the Bézier curve, and restoring stroke attributes such as line width, end caps, joint styles and dashed patterns, the conversion from fill to stroke is achieved.

Benefits of technology

The key features of the stroke path have been restored, ensuring that the stroke path can be effectively used for cutting and automatic recognition, meeting the needs of cutters and software recognition.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123036624A_ABST
    Figure CN123036624A_ABST
Patent Text Reader

Abstract

A computer-implemented method for defining a stroke. The method includes defining outlines of the fill shape, defining parallel segments in the defined outlines, and converting Bézier segments in the defined outlines to approximations having straight line segments. Parallel pairs of segments are identified, where the most prevalent distance between the identified parallel pairs is identified as a line width. End cap defining segments are identified as parallel segments having only non-parallel segments between them. The centerlines of that pair of segments are then identified as end cap locations. The centerlines of the remaining non-end cap defining segments are connected to each other, and adjacent segments and their respective centerlines are also connected. The centerlines are classified as complete or incomplete. Pairs of incomplete segments and their respective centerlines are connected, and collinear segments are merged. The connected centerlines are then converted to an output path defined by the stroke.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] Cross-reference to related applications This invention claims priority from European application No. EP24165727.9 entitled “METHOD AND SYSTEMS FORCONVERTING FILL TO STROKE IN A GRAPHICS FILE”, filed on March 24, 2024, the entire contents of which are incorporated herein by reference. Background Technology

[0002] In some processes, stroke paths are converted to fill paths, after which many desired characteristics of the stroke path are lost, such as the shape of the original centerline and the line width of the original stroke. For example, a stroke cutting path that has been converted to a fill path may not be usable as a guide for a cutter (such as a cutter on a cutting table). Similarly, stroke registration marks that have been converted to fill may no longer be recognized by software in an automated manner.

[0003] As background, path construction in graphic files (such as portable document files (PDFs) commonly used in the printing and publishing fields) incorporates several known concepts and definitions used in this paper.

[0004] Typically, the "path" referred to in this article includes a series of straight lines (lineto) and Bézier curves (curveto). The straight lines are "drawn" between two coordinates: a starting point and an ending point. Now refer to... Figure 1 Bézier curves (e.g., curve 100) are also drawn between the starting point P0 and the ending point P3, but with two additional control points P1 and P2 defining the curvature. A drawn Bézier curve is typically defined by a quadrilateral 110 bounded by its two endpoints and two control points. “Stroke” a path means rendering the path along its series of straight lines and curves according to several parameters. These parameters are, in particular: • Line width — The thickness of lines and curves drawn that define the path as their center line.

[0005] • Knitted cap style - reference Figure 2A In a PDF, unconnected start or end points are typically capped in one of three ways: flat end cap 210, round end cap 212, or square end cap 214.

[0006] • Line joint style - Reference Figure 2B In the PDF, the joints between connected segments (lines, Béziers) can be drawn according to three different styles: miter joint 220, rounded joint 222, or bevel joint 224. Miter joints are usually controlled by an additional "miter limit" parameter.

[0007] • Dashed line pattern – now for reference Figure 2CThe dashed pattern 232 in the PDF can be set to stroke the path, thereby limiting the number and size of the dashes and gaps. Figure 2C The value “[2 3] 0” represents the coordinate system unit length of the “on” dashed line and the coordinate system unit length of the “off” dashed line, as well as the offset in coordinate system units from the first point of the stroke. The ends of each dashed line will be drawn according to the line cap style, and the dashed lines around the corners will be drawn according to the line join style.

[0008] • Non-proportional scaling – now refer to Figure 2D The drawing in the PDF may be affected by additional transformation matrices, which can be used to move, rotate, scale, and skew the drawn paths, such as a scaled circle 240 and a scaled dashed line Bézier 242. Since scaling can be non-proportional, the line width can vary along lines with different orientations.

[0009] Converting a stroke path to a fill is known in the art and is referred to herein as the "stroke-to-fill action". When a stroke path is converted to a fill, the result is one or more closed fill paths without a stroke, wherein the shape of one or more of these paths depends on the stroke parameters. Figure 3 The example depicted includes a row 310 with a stroke shape corresponding to the column label as shown and a corresponding row 320 with a fill shape corresponding to the fill shape in the previous row. The [red] line around the fill shape in row 320 (e.g., a rectangular line 322 around the straight flat-end cap fill shape 324) indicates the shape of the closed fill path generated by converting the stroke to the fill. Summary of the Invention

[0010] One aspect of the invention relates to a computer-implemented method for defining a stroke corresponding to a fill shape in a graphic file. In an embodiment, the fill shape comprises a shape previously converted from an original stroke using a stroke-to-fill algorithm. The method includes the steps of: defining a contour of the fill shape; defining parallel segments in the defined contour, including converting Bézier segments in the defined contour into approximations with straight line segments; and identifying parallel pairs of segments within a predetermined tolerance. The most common distance between the identified parallel pairs is then identified as a linewidth corresponding to the resulting stroke, and parallel pairs with distances different from the identified linewidths are discarded. Additional steps may be performed to further reduce the number of parallel pairs, for example, by creating multiple quadrilaterals representing the endpoints of each pair of parallel segments, and for segments parallel to more than one other segment, only pairs forming the points of the quadrilateral with the least distortion are retained. Next, end-cap defined segments are identified as parallel segments having only non-parallel segments between them. The centerline of the segment pair is then identified as the end-cap position. The centerlines of the remaining non-end-cap defined segments are connected to each other, and adjacent segments and their respective centerlines are also connected. Centerlines whose opposite ends connect to an end cap or another centerline are classified as completed, and remaining centerlines are classified as incomplete. Pairs of incomplete segments and their respective centerlines are connected by intersection and by merging collinear segments. The connected centerlines are then converted into output paths with defined strokes.

[0011] Additional stroke attributes, such as color, alpha, and overprint, can be defined based on the original fill attributes. The method may include creating a Bézier curve from one or more line segments via curve fitting. The method may also include defining an end cap style for each end cap. Identifying a round end cap style may include analyzing a plurality of non-parallel segments defined between two parallel segments and determining that the endpoints of the plurality of non-parallel segments are approximately located at a constant distance from the defined end cap of the corresponding center line. Identifying a square or flat end cap style may include determining that the endpoints of one or more non-parallel segments defined between two parallel segments are located on the connecting line between the parallel segments.

[0012] The method may further include defining the line joint style as miter, rounded, or beveled. This may include identifying the intersection of the centerlines of adjacent non-parallel and non-endcap segment pairs, and determining whether the corresponding endpoints of the adjacent non-parallel segments are located at a constant distance from the intersection, half the width of the identified line, thus identifying the joint as a rounded joint, and if the corresponding endpoints of the segments are collinear, then identifying the joint as a miter or beveled joint. The method may further include identifying a pattern of repeating strokes of a common length separated by gaps of common length as a converted dashed stroke. Attached Figure Description

[0013] Figure 1 An exemplary Bézier curve is depicted.

[0014] Figure 2A The different types of end caps used for outlining are described.

[0015] Figure 2B Different types of joining known in the art for joining strokes are depicted.

[0016] Figure 2C The lines are depicted as dashed.

[0017] Figure 2D The scaled shape is depicted.

[0018] Figure 3 It is a table that depicts different types of shapes and their corresponding representations as fill and stroke.

[0019] Figure 4A It depicts the outline of straight lines in the fill and the corresponding strokes.

[0020] Figure 4B It depicts the outline of the composite line in the fill and the corresponding stroke.

[0021] Figure 4C It depicts the outline of intersecting lines and the corresponding strokes in the fill.

[0022] Figure 4D It depicts the outline of the self-intersecting lines in the fill and the corresponding stroke.

[0023] Figure 4E The outline of the Bézier curve and its corresponding stroke are depicted within the fill.

[0024] Figure 5A It is a table depicting different types of shapes and their corresponding contours and centerlines formed using the Voronoi partitioning algorithm.

[0025] Figure 5B Depicting Figure 5A The magnified portion of the Bézier curve unit depicted in the figure.

[0026] Figure 5C Depicting Figure 5A The enlarged portion of the Bézier curve and the corresponding stroke defined using the exemplary Voronoi partitioning algorithm method for converting fill to stroke.

[0027] Figure 6 This describes the steps after the fill-to-stroke conversion using the exemplary Voronoi partitioning algorithm. Figure 5A A table in the shape of .

[0028] Figure 7 The enlarged portion of the self-intersecting shape profile and the corresponding centerline defined by the Voronoi partitioning algorithm are depicted.

[0029] Figure 8 The outline of the composite line shape and the corresponding center line are depicted to illustrate the exemplary parallel line segment fill to stroke algorithm.

[0030] Figure 9 A composite Bézier curve profile is depicted to illustrate aspects of an exemplary parallel line segment fill-to-stroke algorithm.

[0031] Figure 10A An example of a fill shape is depicted to illustrate the method steps of an exemplary parallel line segment fill to stroke algorithm.

[0032] Figure 10B The diagram depicts the initial steps following the execution of the exemplary parallel line segment fill-to-stroke algorithm. Figure 10A The outline of the shape.

[0033] Figure 10C The additional steps following the execution of the exemplary parallel line segment fill-to-stroke algorithm are described. Figure 10B The outline of the shape.

[0034] Figure 11A depicts the identification and connection steps of intermediate line segment pairs after performing the exemplary parallel line segment fill to stroke algorithm. Figure 10B It is part of the shape.

[0035] Figure 11B The highlighted portion depicts the shape of Figure 11A.

[0036] Figure 11C It depicts the state after removing redundant quadrilaterals. Figure 10A The shape.

[0037] Figure 12 The centerline is depicted by an intermediate step of the exemplary parallel line segment fill to stroke algorithm performed after the steps shown in Figures 11A-11D.

[0038] Figure 13 The diagram depicts the intermediate step after performing the exemplary parallel line segment fill to stroke algorithm centerline connection. Figure 12 The center line.

[0039] Figure 14A depicts a stroke-based shape, which includes a shape corresponding to the stroke after performing the exemplary parallel line segment fill-to-stroke algorithm. Figure 10A The stroke of a filled shape consists of multiple straight line segments.

[0040] Figure 14B The magnified portion of Figure 14A is depicted.

[0041] Figure 15The outline-based shape of Figure 14A is depicted after the Bézier curve is reconstructed from multiple line segments. Detailed Implementation

[0042] For reasons noted in the background art, there are various reasons why it may be necessary to revert to a stroke after it has been converted to a fill. Typically, information or instructions defining the stroke are discarded after conversion to fill. Therefore, there is a need in the art to automatically convert at least a selected fill line art into stroke line art in a drawing file (especially a PDF file). This is essentially the inverse operation of the "convert stroke to fill" action.

[0043] Before converting the fill shape into a stroke path, the fill shape is first analyzed to characterize the shape type. Figure 3 Several exemplary shapes for both stroke and fill formats are depicted, which may be particularly well-suited for fill-to-stroke conversion.

[0044] Each shape in the fill format can be defined by the outline of the fill area. Based on these outlines, the stroke can be defined by the following parameters: the outline of the stroke path (center line), line width, cap style, join style, dash pattern, and matrix transformation.

[0045] Figure 4A This depicts the transformation of a rectangle 400 defining a fill profile into a straight line 410 defined by a flat-top (or square-top) cap. This is the simplest case. The fill profile is a rectangle, which can be easily identified, and its width can be calculated and defined as a stroke path with either a flat-top end cap or a protruding square end cap. Figure 4B (A composite path formed only by straight lines) Figure 4C (Intersecting paths with straight lines) Figure 4D (Self-intersecting paths with straight lines) and Figure 4E The shape of a single Bézier can be defined using a skeletonization algorithm.

[0046] Various skeletonization algorithms are known in this art, including but not limited to median calculation, straight skeletons, and Voronoi partitioning algorithms. The advantages of the system described later in this document can be better understood by referring to the implementation of skeletonization algorithms using Voronoi partitioning.

[0047] Voronoi division First, a skeletonization algorithm is used to generate the centerline, which produces multiple small, unconnected lines (essentially a series of moveto-lineto operators, such as...) Figure 5A As depicted in [the text]. Figure 5BThe image depicts an enlarged portion of the end of the Bézier shape 550. Point 552 (circled) represents the intersection of the Voronoi diagram edges contained within the original (filled) contour and consisting of the edges of three different Voronoi units, which (by definition) are equidistant from the three different original vertices 554, 555, and 556 of the input contour. A line is created between point 552 and a similar point 558 at the opposite end, with a prominent square end cap and appropriate line width, defining the stroke transformed from the fill, where the prominent end cap closely fits the original stroke shape.

[0048] For Bézier, this means the final portion of the "bend" will be straightened over half the line width. All that remains is to cut off the portion of the line "outside" the green circles between the two end caps. One option is to manually fit the stroke inside the fill using the protruding square end caps and the original line width. In many cases, this yields surprisingly good results, such as... Figure 6 While this is observable, improvements are still needed for the corners between straight lines and for line art that is not scaled proportionally.

[0049] refer to Figure 7 For corners between straight lines, a composite skeleton path created using the Voronoi algorithm defines the skeleton line 710, which does not follow the original stroke line but is somewhat rounded and has branches 712 leading to the "outward-pointing" corner 714. For example... Figure 7 As shown in B, converting the fill to a stroke will benefit the positioning point 716. If the algorithm is required to determine whether the rounded corner should be "straightened," it is necessary to first determine whether the source of the straightening is a straight corner or a Bézier curve. Unfortunately, Voronoi partitioning usually involves approximating the Bézier curve with a straight line, so this information may be difficult or impossible to retrieve. Therefore, alternative methods are described.

[0050] Among alternative methods, Voronoi partitioning can generate centerlines for any fill shape. However, obtaining the stroke path from the Voronoi partitioning may require extensive post-processing of the Voronoi segments.

[0051] Parallel line segment method Since the fill shape is the result of a stroke-to-fill conversion in this case, the original center line can be found by assuming that the stroke-to-fill conversion produces a fill shape that includes multiple pairs of parallel line segments.

[0052] from Figure 8Starting with shape 800 as depicted in A, the algorithm first detects line segments that are parallel to each other. For example, segments 810 and 812 are parallel to each other, as are pairs of segments 820 and 822, and pairs of segments 830 and 832. If more than two segments are found to be parallel, additional logic can be implemented to determine which pairs belong together for the purposes of the algorithm. The algorithm detects segments for drawing the "end cap" of the stroke by identifying unpaired connecting segments 814 between the two endpoints (811 and 813) of two parallel segments (810 and 812) within a short distance, which can then be identified as the original line width of the original stroke path. Center lines (e.g., 816 and 826) are defined as equidistant between each pair of parallel segments (e.g., 810 and 812; 820 and 822, respectively). Unconnected center lines 816, 826, and other center lines (not shown) can be connected by calculating the locations where the individual center lines of each segment intersect each other to form a single connecting outline, considering only the intersection locations included within the fill. The portion of the connecting contour line that intersects the fill contour line but is not at the "end cap" segment is cut off, or only the portion between the intersection points and the fill contour line segment identified as the "end cap" are retained.

[0053] Now for reference Figure 9 One method for finding parallel segments, as depicted in the diagram, is to approximate the Bézier as a series of short straight line segments, then run a centerline algorithm on these segments, and then reconstruct the Bézier for each segment 910, 912 based on the resulting straight line centerlines, for the portion of the Bézier originating from the filled contour line. The straight lines originating from the “straightened” Bézier are tracked during the algorithm's completion. Then, using algorithms known in the art, a new Bézier is fitted with the already generated connected centerline segments, such as those described in https: / / stackoverflow.com / questions / 42315048 / bezier-curve-fitting-with-known-end-points?noredirect=1&lq=1, which is incorporated herein by reference.

[0054] Compare Both Voronoi partitioning and the parallel segment algorithm can generate centerlines for the fill to be used for equivalent strokes. While Voronoi partitioning is applicable to arbitrary fill shapes, it generally requires more post-processing than the parallel segment method, especially due to the challenge of calculating which Voronoi segments need to be discarded. Additionally, reconstructing a Bézier curve requires tracking which Voronoi segments were generated by line segments produced by the curve-to-line transformation. The parallel segment method, as described above, is best suited for fill shapes that were originally strokes, is potentially much faster due to less post-processing, and includes a more direct method for reconstructing Bézier curves. The parallel segment method is particularly advantageous when you want to reverse the previous stroke-to-fill transformation.

[0055] Detailed method for converting parallel line segment fill to stroke The steps for implementing the parallel line segment fill to stroke method discussed in this article are as follows. First, the algorithm finds the center line. Now refer to... Figure 10A The overall filled shape 1000 is depicted, and all Bézier segments in the input are converted into approximations with straight line segments (e.g., 1010, 1020, 1030). Parallel segment pairs are identified from a subset of all segments using a predetermined tolerance for the angles of the segment pairs. The use of tolerance is desirable due to limited floating-point precision and because segments in an approximate Bézier segment may not be perfectly parallel. A reasonable tolerance value for the angle difference between parallel segments is found to be between 0.005 and 0.02 radians, more preferably 0.08–1.2 radians, and most preferably 0.09, 1.0, or 1.1 radians.

[0056] This is different from simply comparing the orientation of each segment with every other segment (which has O(n)). 2 Finding parallel segments in a large set of segments can be time-consuming. This can be optimized by the following steps: First, sort the segments by orientation (absolute angle relative to a fixed axis in the coordinate system), then iterate through the sorted list once, stopping the orientation comparison as soon as the difference is greater than the tolerance. This reduces the complexity to O(n log(n)). The subset of parallel segments that identify parallel pairs is determined by first calculating the absolute angle (relative to a fixed axis) of all segments in the coordinate system.

[0057] Determine the most common distance of 1050 between these identified pairs and mark it as the line width of the resulting stroke, leaving Figure 10B The outline is defined in the middle. The 'most common' distance is the trimmed weighted average distance between parallel segments (i.e., weighted by the length of these segments, so longer segments contribute more than shorter segments), and pairs with distances that differ from the identified line width within the tolerance (e.g., 1%) are discarded.

[0058] The algorithm identifies the segment defining the end cap 1060 by identifying parallel segments 1070 and 1080, which have endpoints 1071 and 1081 connected to each other only through one or more unpaired segments 1073 (e.g., not part of the segment pairs retained after discarding non-most common distance pairs). Endpoints 1071 and 1081 can also be referred to as non-adjacent connected endpoints because they do not have connections to adjacent segment pairs, but are only connected to each other. The midpoint 1075 between the corresponding non-adjacent connected endpoints defines the end cap position.

[0059] It is worth noting that, despite Figure 10B The figures shown represent a relatively small number of parallel pairs, but the actual number may be much larger, as shown in Figure 11A-. Figure 11C See in more detail.

[0060] Now refer to Figure 11A- Figure 11C The algorithm further reduces the number of non-end-cap-bound segment pairs by defining multiple quadrilaterals within shape 1100, such as 1110, 1120, etc., by subsequently connecting the corresponding endpoints of each of the remaining parallel segment pairs. For segments parallel to more than one other segment, the algorithm retains only pairs that form a minimum distortion quadpoint (trapezoidal), which is formed by the two segments of the segment pair with respect to the perpendicular line between the two segments. However, end-cap-bound segment pairs are not discarded. The minimum distortion quadpoint is identified by determining the angular difference (normalized to [0, π / 2]) between the sides of the quadpoint formed by the two segments relative to the line orthogonal to that segment. The absolute values ​​of these differences are summed over the two connecting lines at the corresponding ends of the segments and compared to the sum of the absolute values ​​of the two connecting lines that connect the corresponding ends of the given segment to the immediately adjacent second parallel segment. Parallel pairs are considered immediately adjacent if one segment in the pair is at least partially orthogonally projected onto the other segment in the pair. Thus, a perfect rectangle will have a quadpoint value of 0. Larger values ​​indicate greater distortion. Figure 11A and Figure 11C The differences between them, such as in Figure 11B The magnified portion illustrates more clearly the quadrilateral generation and the discarding of shaded quadrilaterals as redundancy. The methods for reducing the number of pairs are not limited to any particular set of steps.

[0061] The algorithm then defines adjacent segment pairs (e.g., 1012, 1014) as two segment pairs, wherein at least one segment of each of the two segment pairs is connected to at least one segment of the other segment pair, the connection including a shared endpoint (e.g., 1013) or adjacent endpoints connected to each other only through one or more unpaired segments. The algorithm then constructs an output line segment for each segment pair as a centerline defining the segments between the segments of the pair, the centerline having a length limited by its intersection with the centerlines of adjacent segment pairs, and for endcap-defined segment pairs, limited by the midpoint 1075 between non-adjacent connected endpoints. The output line segments with common endpoints are then connected into connecting paths, each connecting path defining a stroke, such as... Figure 12 As shown in the image.

[0062] Now for reference Figure 12 In an embodiment, the algorithm can also designate centerlines that are connected at both ends (either to an end cap or to another centerline) as "complete". Pairs of incomplete segments that are not adjacent (e.g., 1210, 1212) are connected, with the connection point of their centerlines located at their geometric intersection. If multiple candidate intersections exist, the intersection that produces the shortest centerline is selected. In the case of collinear centerlines (e.g., 1214, 1216), the connection point can be placed anywhere in between. Collinear segments are merged, producing... Figure 13 The shape is defined specifically for this example. Next, the connected center line is converted into a stroke output path, for example... Figure 14A and Figure 14B The example depicts multiple short stroke segments. Stroke attributes such as color, alpha, and overprint can be defined based on the original fill attributes. The Bézier curve is reconstructed from line segments through curve fitting, thus providing... Figure 15 The results described in the text.

[0063] For end caps, only two styles need to be distinguished, as square end caps and prominent flat-top end caps are not visually distinguishable. Round-top end caps are detected by analyzing non-parallel, unpaired segments between segment pairs. The endpoints of these segments should be approximately located at a constant distance from the end cap's centerline calculated above. Square / flat-top end caps are similarly detected by testing whether the endpoints of these segments lie on the connecting line 1073 between parallel segments at the end cap's location.

[0064] Determining the line joint pattern involves identifying which of three patterns exists: miter, rounded, or beveled. The joint pattern is detected by analyzing the residual sequence of non-parallel, non-endcap segments. The algorithm used for this involves finding the intersection of adjacent centerlines and determining whether the endpoints of these segments are approximately located at a constant distance (approximately 1 / 2 line width) from that intersection. In this case, the joint is defined as a rounded joint. If the endpoints of these segments are collinear, the joint is defined as a miter or beveled joint.

[0065] Identifying dashed patterns involves identifying several different fill shapes that together form a transformed dashed stroke. Typically, when a dashed stroke is converted to a fill, it produces a path with many individual subpaths, each dashed corresponding to one subpath. The algorithm described above initially converts each dashed line individually into a short stroke line corresponding to each of these subpaths. A second pass algorithm can then look for relationships between groups of short stroke lines. For example, after converting each fill subpath to a stroke subpath, an exemplary second pass algorithm could include the following steps: calculating the length of each stroke subpath, placing these lengths in a bucket with a tolerance (e.g., 1%), calculating the length of the gap between the endpoints of nearby stroke subpaths, and placing these lengths in a bucket (again, with a similar tolerance). The buckets with stroke lengths and gap lengths are analyzed to find the dashed pattern of the original stroke path. Nearby stroke subpaths are then connected. For example, two stroke subpaths with straight line segments at their connection point can be connected, either by merging them if they are collinear, or by extending the straight line segments to their geometric intersection. For connecting two stroke subpaths, where one segment at the connection point is Bézier, fit a curve through the two stroke subpaths to form a new set of connected subpaths. Repeat this process until all stroke subpaths are connected into a final path comprising a single subpath. Then, set the dashed pattern properties, as previously determined, onto this final path.

[0066] Although the invention has been described and illustrated herein with reference to specific embodiments, it is not intended to be limited to the details shown. Rather, various modifications to the details may be made within the scope of the claims and their equivalents without departing from the invention.

Claims

1. A computer-implemented method for defining one or more strokes corresponding to a fill shape in a drawing file, the method comprising the steps of: a) Define the outline of the filled shape; b) Convert the Bézier segment in the defined contour into an approximation with straight line segments; c) Mark the parallel pairs of segments within the predetermined angular tolerance; d) Identify the most common distance between the identified parallel pairs as the line width corresponding to the resulting stroke, and discard parallel pairs with distances different from the identified line widths, wherein the most common distance between the identified parallel pairs is the trimmed weighted average distance between the identified parallel pairs, the trimmed weighted average distance being weighted by the length of the identified parallel pairs of the segment. e) Identify end cap-defined segment pairs as comprising two segments, wherein adjacent endpoints are connected to each other by one or more unpaired segments; f) When multiple segment pairs share a common segment, discard all segment pairs except those that define the minimum skewed trapezoid, without discarding any endcap-defined segment pairs; g) Identify adjacent segment pairs as two segment pairs, wherein at least one segment of each of the two segment pairs has a connection to at least one segment of the other of the two segment pairs, the connection including shared endpoints or adjacent endpoints connected to each other only through one or more unpaired segments; h) For each segment pair, construct an output line segment as a centerline defining the segments between the segments of the segment pair, the centerline having a length limited by the intersection with the centerlines of the adjacent segment pairs, and for a segment pair defining an end cap that is not connected to a pair of endpoints of the adjacent segment pair, the length is limited by the midpoint between the unconnected endpoints of the end cap defining the segment pair. i) Connect the output segments with a common endpoint to form a connection path, each connection path defining one of the one or more strokes.

2. The method according to claim 1, further comprising the following step: j) Classify the centerline whose opposite end is connected to the end cap or another centerline as completed, and classify the remaining centerlines as incomplete; k) Connect the pairs of incomplete center lines by intersecting and by merging collinear incomplete center lines; and convert the connected center lines into an output path that defines one of the one or more strokes.

3. The method of claim 1 further comprises defining an additional stroke attribute based on an original fill attribute, the original fill attribute being selected from the group consisting of: color, alpha, and overprint.

4. The method of claim 1, further comprising constructing a Bézier curve from one or more output line segments by curve fitting.

5. The method of claim 1, further comprising defining an end cap style for each end cap.

6. The method of claim 5 further includes identifying the round-head end cap style by analyzing a plurality of non-parallel segments defined between two parallel segments and determining that the endpoints of the plurality of non-parallel segments are located at a constant distance from the defined end cap of the corresponding center line.

7. The method of claim 5, further comprising identifying a square or flat-top cap style by determining that the endpoints of one or more non-parallel segments defined between two parallel segments lie on a connecting line between the parallel segments.

8. The method of claim 1, further comprising defining the line joining style as miter, rounded, or beveled.

9. The method of claim 8, further comprising identifying the intersection of the centerlines of adjacent non-parallel and non-end cap segments, determining whether the corresponding endpoints of the adjacent non-parallel segments are located at a constant distance from the intersection, equal to half the width of the identified line, identifying the joint as a rounded joint, and identifying the joint as a miter joint or bevel joint if the corresponding endpoints of the segments are collinear.

10. The method of claim 1, further comprising identifying a plurality of stroke subpaths as commonly defining a transformed dashed stroke with a dashed pattern, the plurality of stroke subpaths having gaps between the nearest stroke subpaths in a repeating pattern of stroke lengths and gaps therebetween.

11. The method of claim 1, wherein the fill shape comprises a shape converted from an original stroke using a stroke-to-fill algorithm.