Implicit image compression method based on file system

By automatically compressing and restoring images at the file system level, the problem of low compression rate of encoded images such as JPEG in existing technologies is solved, implicit image compression is realized, compression efficiency is improved and storage space is saved.

CN121509671APending Publication Date: 2026-02-10CHONGQING INST OF EAST CHINA NORMAL UNIV +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511795636.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-02
Publication Date
2026-02-10

AI Technical Summary

Technical Problem

Existing compressed file systems have low compression rates for encoded images such as JPEG, making further optimization difficult.

Method used

The method of image compression and restoration is set at the file system level. It automatically converts user-stored images into a high compression ratio format and restores them to the original format when the user reads them. The compression process is optimized through steps such as image buffering, pre-compression, image classification and selective restoration.

Benefits of technology

Without the user's awareness, it improves image compression efficiency, saves storage space, and reduces the performance impact of frequent image access.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121509671A_ABST
    Figure CN121509671A_ABST
Patent Text Reader

Abstract

The invention discloses an implicit image compression method based on a file system, which is characterized by comprising the steps of setting image compression, restoration and the like on a file system layer, automatically converting an image stored by a user into a format with a higher compression ratio under the condition that the user does not perceive the image, and restoring the image into an original format when the user reads the image. In the image compression step, the image is decoded and then recoded into a high-compression-ratio format for storage, and metadata of an original image is recorded; the image restoration is used for decoding an image in a high-compression-ratio format, recoding the image into an original format and returning the image; the image compression method comprises the steps of image buffering, pre-compression, image classification, selective restoration based on intention and the like. Compared with the prior art, the method has the advantages that the storage speed is optimized, the influence on the performance of frequently accessed images is reduced, the compression efficiency is improved, the problem that the compression rate of a general compressed file system on encoded images such as JPEG is low is effectively solved, and the storage space can be remarkably saved on the premise that the operation habit of a user is not changed.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of image compression technology, and in particular to an implicit image compression method based on a file system. Background Technology

[0002] Operating systems internally use file systems to manage stored files, and compressed file systems are a special type of file system. Compressed file systems can compress user-saved file data before saving it to storage media, and automatically decompress and provide it to the user when the file is accessed. This process does not require active user control, thus providing implicit file compression that is imperceptible to the user. There are many sub-designs within this category, including regular file systems that provide additional compression functionality, such as BtrFS; file systems specifically designed for compression, such as SquashFS; and file systems designed for read-only files, such as EROFS. The problem with these file systems is that they use general compression algorithms designed for text, such as LZO, which are not effective at compressing images.

[0003] Currently, the mainstream image format is JPEG, which has already been encoded rather than representing the original pixels, making it difficult to compress further. To further compress image size, new technologies such as HEIF have emerged; however, due to compatibility and user habits, they cannot directly replace JPEG as the mainstream encoding format.

[0004] In summary, existing compressed file systems suffer from low compression rates for encoded images such as JPEGs. Therefore, how to compress image files has become a pressing issue that needs to be addressed. Summary of the Invention

[0005] The purpose of this invention is to address the shortcomings of existing technologies by providing an implicit image compression method based on a file system. This method employs a file system layer to configure image compression and restoration, using the file system as an intermediate layer for automatic compression and restoration of stored images. This allows for image compression without the user's awareness, automatically converting user-stored images to a higher compression ratio format, and restoring them to the original format upon user retrieval. In the image compression step, this method intercepts user-saved image files, decodes them, re-encodes them into a high-compression ratio format (such as HEVC) for storage, and records the original image's metadata. In the image restoration step, when the user reads the file, the high-compression ratio image is decoded and re-encoded back to the original format, returning it without the user's awareness. This invention also includes improvements such as an image buffering step, a pre-compression step, an image classification step, and intent-based selective restoration to optimize saving speed, reduce the performance impact on frequently accessed images, and further improve compression efficiency. It effectively solves the problem of low compression rate of encoded images such as JPEG by general compression file systems. It can achieve implicit image compression through the file system without changing user operating habits. Therefore, it can be completed automatically without the user's awareness of the compression and decompression process, thereby saving storage space on user devices. It has good application prospects and commercial development value.

[0006] The specific technical solution to achieve the purpose of this invention is: an implicit image compression method based on a file system, including a file system, characterized by using the file system as an intermediate layer for automatic image compression and restoration storage, enabling users to compress images without their awareness, automatically converting user-stored images into a format with a higher compression ratio, and restoring them to the original format when the user reads them.

[0007] This invention includes an image compression step and an image restoration step. The image compression step decodes the user-saved uncompressed original image into a raster image, re-encodes it into a unified high-compression ratio format, and saves it. Simultaneously, it records and saves the metadata of the uncompressed image, and then removes the original uncompressed image. It can be stored on a physical storage medium or stored in another file system for actual storage. The compression process can be lossy or lossless. For a small number of special image formats, decoding to a raster image is not necessary; instead, the image can be directly converted to a new high-compression ratio format. When a user views the image in a directory, the metadata of the uncompressed image allows the user to perceive the file as the original uncompressed image, rather than directly seeing a compressed image.

[0008] The image restoration step is responsible for checking the path of the uncompressed image that the user is trying to open when the user reads image data. If the image is uncompressed, it is returned directly; otherwise, the corresponding compressed image is found, decoded into a pixel-based raster image, and re-encoded into its original format before being returned to the user. When the user obtains image file metadata, the metadata storage file corresponding to the uncompressed version of the compressed image is read and returned to the user.

[0009] As an improvement to the image compression step, this invention provides an image buffering step. This step saves the image in its original format after the user writes it, without any additional processing. This saving method is faster and reduces problems such as data storage failure due to unexpected events like shutdown, and image quality degradation caused by lossy compression. The image compression step, on the other hand, runs intermittently in the background, checking newly saved uncompressed images and compressing them accordingly.

[0010] As an improvement to the image buffering step, this invention provides a pre-compression step. After writing the image, the user can perform an initial compression using a lossless and fast compression method and save it. Subsequently, the image compression step will perform a second compression using a format with a higher compression ratio.

[0011] As an improvement to the image buffering step, this invention provides an image classification step. When an image has not yet been compressed, the image classification step records the frequency at which the user reads the image. When the frequency at which the user reads an image exceeds a threshold within a compression cycle, the image is identified as an active image and therefore will not be compressed in this cycle. Subsequently, the count is reset to zero and checked again during the next compression cycle.

[0012] As an improvement to the image restoration process, this invention provides intent-based selective restoration. When a user opens a compressed image file, the image restoration step does not directly restore it to the original format but waits for further processing. If the user directly obtains the file data, it is then encoded back into the original format and provided to the user. However, if the user provides the file to the image display interface, it can be directly provided to the image interface for display in either the compressed format or the decoded pixel format, thereby achieving a speed-up effect.

[0013] As an improvement to the image compression step, this invention provides a unified compression of multiple similar images. For multiple saved similar images, the image compression step can use a similar image compression algorithm to compress them into a single compressed file to further reduce space usage.

[0014] As an improvement to the image compression process, when the compressed image contains non-image data, this data will be saved directly without processing. This is to ensure compatibility with the technique of saving compressed files in an openable image.

[0015] Compared with existing technologies, this invention optimizes storage speed, reduces the performance impact on frequently accessed images, and further improves compression efficiency. It effectively solves the problem of low compression rate of encoded images such as JPEG by general compression file systems. It can achieve implicit image compression through the file system without changing user operating habits. Therefore, it can be completed automatically without the user's awareness of the compression and decompression process, thereby saving storage space on user devices. It has good application prospects and commercial development value. Attached Figure Description

[0016] Figure 1 This is a flowchart of the present invention. Detailed Implementation

[0017] See Figure 1 This invention utilizes a file system as an intermediate layer for automatically compressing and restoring stored compressed images. Without the user's awareness, it automatically converts the user-stored image to a format with a higher compression ratio and restores it to its original format when the user reads it. The invention includes the following steps: Step 1: Image Compression The original image file requested by the user is converted into a high-compression format for storage, and the metadata of the original image file is recorded.

[0018] Step 2: Image Restoration When a user requests to read the original image file, the corresponding high-compression format image file is decoded and re-encoded into the original image file format before being returned to the user.

[0019] The image compression in step 1 specifically includes: Step 1-1: Image Buffer The original image file is buffered so that image compression is performed asynchronously in the background of the system. Step 1-2: Pre-compression The user-saved original image file is temporarily stored in its original format, and then the temporarily stored original image file is compressed and converted; the pre-compression uses a first compression algorithm to quickly compress the temporarily stored original image file; Steps 1-3: Image Compression The pre-compressed image file is further compressed using a second compression algorithm, which has a higher compression ratio than the first compression algorithm; the first compression algorithm has a higher compression speed than the second compression algorithm.

[0020] The image restoration in step 2 specifically includes: Step 2-1: Image Classification The frequency of user access to temporarily stored raw image files is counted. When the access frequency exceeds a threshold, the compression process for that image file is skipped during the next image compression. Step 2-2: Intent-based selective restoration Determine the user's intent to read the image file. If the intent is to directly obtain the file data, then perform the step of re-encoding it to the original format; if the intent is to display the image, then send the decoded image data directly to the image display interface.

[0021] For multiple similar original image files, the image compression uses a similar image compression algorithm to compress them into a single compressed file. When the original image file contains non-image data, the non-image data is separated and stored independently of the image content.

[0022] The following is an example implementation on an Android phone. The compression algorithm used is merely an example to further illustrate the invention. Obviously, the described embodiments are only a part of the embodiments of the invention, not all of them. All other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this invention.

[0023] Currently, mobile phones, as portable devices with camera functions, store photos taken by them in a single folder. Furthermore, mobile devices have high storage space requirements, making this an ideal implementation target for this invention. This embodiment is implemented based on the user-space file system FUSE, providing a POSIX standard interface to reduce implementation difficulty and improve portability. This file system is mounted in the default save folder for photos taken by the mobile phone's camera.

[0024] Example 1 The following describes the specific implementation steps of the present invention using examples of users taking photos and viewing photos in an album: 1) When a user takes a photo, the camera writes the photo to a folder in JPEG format, and the pre-compression step directly converts it to JPEG-XL format.

[0025] 2) The image buffering step saves the initially compressed image to another path. The specific storage medium is the responsibility of the file system to which that path belongs.

[0026] 3) The image classification step records the number of read calls. If a photo is accessed for more than 10 days in a month, it is marked as active.

[0027] 4) The image compression step is triggered once a month. It checks all images in the folder where the pre-compression step is saved. If an image is marked as active by the image classification step, it is skipped. Otherwise, it is decoded into pixel raster format and then encoded into HEVC format and stored in another path. The file system to which that path belongs is responsible for the actual storage.

[0028] 5) When a user views a photo from the album, the image restoration step retrieves the image's filename, thumbnail, and other metadata from the metadata file and returns it to the application. When a user clicks on a file, Android internally opens the file and calls BitmapFactory or ImageDecoder for processing. Therefore, in this embodiment, the highly compressed HEVC format is directly decoded into a pixelated image and returned, rather than restored to the original format.

[0029] The above is merely a further description of the present invention and is not intended to limit the scope of this patent. Any equivalent implementation of the present invention should be included within the scope of the claims of this patent.

Claims

1. An implicit image compression method based on a file system, comprising a file system, characterized in that, This system utilizes a file system as an intermediate layer for automatically compressing and restoring stored compressed images. Without the user's awareness, it automatically converts the user-stored image to a format with a higher compression ratio and restores it to its original format when the user reads it. This includes the following steps: Step 1: Image Compression The original image file requested by the user is converted into a high-compression format for storage, and the metadata of the original image file is recorded. Step 2: Image Restoration When a user requests to read the original image file, the corresponding high-compression format image file is decoded and re-encoded into the original image file format before being returned to the user.

2. The implicit image compression method based on a file system according to claim 1, characterized in that, The image compression in step 1 specifically includes: Step 1-1: Image Buffer The original image file is buffered so that image compression is performed asynchronously in the background of the system. Step 1-2: Pre-compression The user-saved original image file is temporarily stored in its original format, and then the temporarily stored original image file is compressed and converted; the pre-compression uses a first compression algorithm to quickly compress the temporarily stored original image file; Steps 1-3: Image Compression The pre-compressed image file is further compressed using a second compression algorithm, which has a higher compression ratio than the first compression algorithm; the first compression algorithm has a higher compression speed than the second compression algorithm.

3. The implicit image compression method based on a file system according to claim 1, characterized in that, The image restoration in step 2 specifically includes: Step 2-1: Image Classification The frequency of user access to temporarily stored raw image files is counted. When the access frequency exceeds a threshold, the compression process for that image file is skipped during the next image compression. Step 2-2: Intent-based selective restoration Determine the user's intent to read the image file. If the intent is to directly obtain the file data, then perform the step of re-encoding it to the original format; if the intent is to display the image, then send the decoded image data directly to the image display interface.

4. The implicit image compression method based on a file system according to claim 1 or claim 2, characterized in that, The image compression method uses a similar image compression algorithm to compress multiple similar original image files into a single compressed file. When the original image file contains non-image data, the non-image data is separated and stored independently of the image content.