Systems and methods for compressing vector graphics
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.
Interactive Citation Constellation Global Citation Ranking
Interactive SVG Citation Constellation renders in Rust/WebAssembly. Prior art cited: 3 · Forward citations: 0.
Claims (8)
- Claim 1Independent Claim
A computer implemented method for generating a compressed shape, the method including: 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 comm
- Claim 2Depends on #1
The computer implemented method of claim 1, wherein the second original shape command defines an absolute target and the method further includes: 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 3Depends 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; and calculating a relative y coordinate by subtracting a current y coordinate from the absolute y coordinate.
- Claim 4Depends 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 5Depends 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 6Depends 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 7Depends 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 8Depends on #1
The computer implemented method claim 1, wherein generating the second compressed shape command further includes: 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.
Technical Overview & Description
CROSS-REFERENCE TO RELATED APPLICATION This application is a U.S. Non-Provisional Application that claims priority to Australian Patent Application No. 2022204492, filed Jun. 24, 2022, which is hereby incorporated by reference in its entirety. TECHNICAL FIELD Aspects of the present disclosure are directed to systems and methods for compressing vector graphics. BACKGROUND Many computer applications make use of vector graphic format images to store and display digital images. As with all digital images, vector graphics have to be stored in memory. Accordingly, there are significant advantages to be had if a vector graphic can be compressed so that, inter alia, less memory is required to store that vector graphic. SUMMARY Described herein is a computer implemented method for generating a compressed shape, the method including: receiving input shape data defining a plurality of shape commands, the plurality of shape commands including an first original shape command and an second original shape command; generating a first compressed shape command, the 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, the 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 version of the second shape command in which one or more parameters defined by the second original shape command are relatively defined; generating an absolute version of the second shape command in which one or more parameters defined by the second original shape command are absolutely defined; and selecting a smaller or equal smallest of the relative version and the absolute version to be the second compressed shape command. Also described herein is a computer implemented method for comp
Cited By — Indexed Forward Citations (0 of 0 total)
No indexed citing patents in this generation yet. Ingest USPTO/PatentsView bulk citation tables via patents-ingest to expand the local forward citation graph.
References Cited — Backward Prior Art (3)
| Patent | Title | Year | Citations |
|---|
Non-Patent Literature (10)
- Anton Khlynovskiy,
- ‘
- Of SVG, Minification and Gzip
- ’
- , Nov. 15, 2017, pp. 1-14 [retrieved on Jul. 6, 2023].
- Battiato, S., Greco, F.,
- &
- Nicotra, S. (2006, February), Compressed SVG Representation of Raster Images Vectorized by DDT Triangulation. In Eurographics Italian Chapter Conference (pp. 233-239).
- C. Seel-audom, W. Naiyapo and V. Chouvatut,
- “