# US 2023/0419556 A1 · Systems and methods for compressing vector graphics

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 2023/0419556 A1
- Document ID: US20230419556A1
- Status: Published application
- Kind: A1
- Application number: 18/211,239
- Filed: 2023-06-17
- Published: 2023-12-28
- Earliest claimed: 2022-06-24
- Assignees: Canva Pty Ltd
- Applicants: Canva Pty Ltd
- Inventors: Henrry Eduardo Iguaro Jaramillo; Stephan Schwiebert; Velislava Yanchina
- Web page: https://patentgrep.com/patent/US20230419556A1

## CPC

- G06T 9/20: Contour coding, e.g. using detection of edges
- G06T 9/00: Image coding (bandwidth or redundancy reduction for static pictures H04N1/41; coding or decoding of static colour picture signals H04N1/64; methods or arrangements for coding, decoding, compressing or decompressing digital video signals H04N19/00)
- G06T: IMAGE DATA PROCESSING OR GENERATION, IN GENERAL

## Abstract

Described herein is a computer implemented method for compressing a shape. The method includes: receiving input shape data defining first and second original shape commands and generating first and second compressed shape commands corresponding thereto. Generating the second compressed shape command includes generating a relative shape command that is a version of the second original shape command in which parameters are relatively defined; generating an absolute shape command that is a version of the second original shape command in which parameters are absolutely defined; and selecting a smaller or equal smallest of the relative shape command and the absolute shape command to be the second compressed shape command.

## Claims

### Claim 1

A computer implemented method for generating a compressed shape, the method comprising:
receiving input shape data defining a first original shape command and a second original shape command;
generating a first compressed shape command corresponding to the first original shape command;
adding the first compressed shape command to the compressed shape;
generating a second compressed shape command corresponding to the second original shape command; and
adding the second compressed shape command to the compressed shape,
wherein generating the second compressed shape command includes:
generating a relative shape command, the relative shape command being a version of the second original shape command in which one or more parameters defined by the second original shape command are relatively defined;
generating an absolute shape command, the absolute shape command being a version of the second original shape command in which the one or more parameters defined by the second original shape command are absolutely defined; and
selecting a smaller or equal smallest of the relative shape command and the absolute shape command to be the second compressed shape command.

### Claim 2 (depends on 1)

The computer implemented method of claim 1, wherein the second original shape command defines an absolute target and the method further comprises:
calculating a relative target based on the absolute target;
generating the relative shape command to include the relative target; and
generating the absolute shape command to include the absolute target.

### Claim 3 (depends on 2)

The computer implemented method of claim 2, wherein the absolute target includes an absolute x coordinate and an absolute y coordinate and calculating the relative target includes at least one of:
calculating a relative x coordinate by subtracting a current x coordinate from the absolute x coordinate;
calculating a relative y coordinate by subtracting a current y coordinate from the absolute y coordinate.

### Claim 4 (depends on 1)

The computer implemented method of claim 1, wherein the second original shape command defines a relative target and the method further includes:
calculating an absolute target based on the relative target;
generating the relative shape command to include the relative target; and
generating the absolute shape command to include the absolute target.

### Claim 5 (depends on 4)

The computer implemented method of claim 4, wherein the relative target includes a relative x coordinate and a relative y coordinate and calculating the absolute target includes at least one of:
calculating an absolute x coordinate by adding a current x coordinate to the relative x coordinate; and
calculating an absolute y coordinate by adding a current y coordinate to the relative y coordinate.

### Claim 6 (depends on 1)

The computer implemented method of claim 1, wherein selecting the smaller or equal smallest of the relative shape command and the absolute shape command includes:
calculating a length of the relative shape command;
calculating a length of the absolute shape command; and
comparing the length of the relative shape command to the length of the absolute shape command.

### Claim 7 (depends on 6)

The computer implemented method of claim 6, wherein:
calculating the length of the relative shape command includes calculating a number of characters in the relative shape command; and
calculating the length of the absolute shape command includes calculating a number of characters in the absolute shape command.

### Claim 8 (depends on 1)

The computer implemented method claim 1, wherein generating the second compressed shape command further comprises:
determining if a straight line defined by the second original shape command is substantially vertical; and
in response to determining that the straight line defined by the second original shape command is substantially vertical, generating the second compressed shape command to be a vertical line shape command, the vertical line shape command defining a y coordinate but no x coordinate.

### Claim 9 (depends on 1)

The computer implemented method of claim 1, wherein generating the second compressed shape command further comprises:
determining if a straight line defined by the second original shape command is substantially horizontal; and
in response to determining that the straight line defined by the second original shape command is substantially horizontal, generating the second compressed shape command to be a horizontal line shape command, the horizontal line shape command defining an x coordinate but no y coordinate.

### Claim 10 (depends on 1)

The computer implemented method of claim 1, wherein
the first original shape command defines a first curve via a first control point, a second control point, and a first curve target point;
the second original shape command defines a second curve via a third control point, a fourth control point, and a second curve target point; and
generating the second compressed shape command includes:
determining whether a join between the first curve and the second curve is a smooth join; and
in response to determining that the join between the first curve and the second curve is a smooth join, generating the second compressed shape command to be a smooth curve type shape command that does not include parameters corresponding to the third control point or the fourth control point.

### Claim 11 (depends on 1)

The computer implemented method of claim 1, further including generating the input shape data by processing an initial set of shape commands, and wherein processing the initial set of shape commands includes processing a first initial shape command by:
determining if a first initial shape command defines a negligible line; and
in response to determining that the first initial shape command does not define a negligible line, including the first initial shape command in the input shape data.

### Claim 12

A computer processing system including:
a processing unit; and
a non-transitory computer-readable storage medium storing instructions, which when executed by the processing unit, cause the processing unit to perform a method comprising:
receiving input shape data defining a first original shape command and a second original shape command;
generating, by the processing unit, a first compressed shape command corresponding to the first original shape command;
adding the first compressed shape command to the compressed shape;
generating a second compressed shape command corresponding to the second original shape command; and
adding the second compressed shape command to the compressed shape,
wherein generating the second compressed shape command includes:
generating a relative shape command, the relative shape command being a version of the second original shape command in which one or more parameters defined by the second original shape command are relatively defined;
generating an absolute shape command, the absolute shape command being a version of the second original shape command in which the one or more parameters defined by the second original shape command are absolutely defined; and
selecting a smaller or equal smallest of the relative shape command and the absolute shape command to be the second compressed shape command.

### Claim 13 (depends on 12)

The computer processing system of claim 12, wherein the second original shape command defines an absolute target and the method further comprises:
calculating a relative target based on the absolute target;
generating the relative shape command to include the relative target; and
generating the absolute shape command to include the absolute target.

### Claim 14 (depends on 13)

The computer processing system of claim 13, wherein the absolute target includes an absolute x coordinate and an absolute y coordinate and calculating the relative target includes at least one of:
calculating a relative x coordinate by subtracting a current x coordinate from the absolute x coordinate;
calculating a relative y coordinate by subtracting a current y coordinate from the absolute y coordinate.

### Claim 15 (depends on 12)

The computer processing system of claim 12, wherein the second original shape command defines a relative target and the method further includes:
calculating an absolute target based on the relative target;
generating the relative shape command to include the relative target; and
generating the absolute shape command to include the absolute target.

### Claim 16 (depends on 15)

The computer processing system of claim 15, wherein the relative target includes a relative x coordinate and a relative y coordinate and calculating the absolute target includes at least one of:
calculating an absolute x coordinate by adding a current x coordinate to the relative x coordinate; and
calculating an absolute y coordinate by adding a current y coordinate to the relative y coordinate.

### Claim 17 (depends on 12)

The computer processing system claim 12, wherein generating the second compressed shape command further comprises:
determining if a straight line defined by the second original shape command is substantially vertical; and
in response to determining that the straight line defined by the second original shape command is substantially vertical, generating the second compressed shape command to be a vertical line shape command, the vertical line shape command defining a y coordinate but no x coordinate.

### Claim 18 (depends on 12)

The computer processing system of claim 12, wherein generating the second compressed shape command further comprises:
determining if a straight line defined by the second original shape command is substantially horizontal; and
in response to determining that the straight line defined by the second original shape command is substantially horizontal, generating the second compressed shape command to be a horizontal line shape command, the horizontal line shape command defining an x coordinate but no y coordinate.

### Claim 19 (depends on 12)

The computer processing system of claim 12, wherein
the first original shape command defines a first curve via a first control point, a second control point, and a first curve target point;
the second original shape command defines a second curve via a third control point, a fourth control point, and a second curve target point; and
generating the second compressed shape command includes:
determining whether a join between the first curve and the second curve is a smooth join; and
in response to determining that the join between the first curve and the second curve is a smooth join, generating the second compressed shape command to be a smooth curve type shape command that does not include parameters corresponding to the third control point or the fourth control point.

### Claim 20

A non-transitory storage medium storing instructions executable by processing unit to cause the processing unit to perform a method comprising:
receiving input shape data defining a first original shape command and a second original shape command;
generating a first compressed shape command corresponding to the first original shape command;
adding the first compressed shape command to the compressed shape;
generating a second compressed shape command corresponding to the second original shape command; and
adding the second compressed shape command to the compressed shape,
wherein generating the second compressed shape command includes:
generating a relative shape command, the relative shape command being a version of the second original shape command in which one or more parameters defined by the second original shape command are relatively defined;
generating an absolute shape command, the absolute shape command being a version of the second original shape command in which the one or more parameters defined by the second original shape command are absolutely defined; and
selecting a smaller or equal smallest of the relative shape command and the absolute shape command to be the second compressed shape command.
