Weight reducing technical method based on JAVA picture

Through the JAVA-based image slimming technology method, including multi-step processing and conversion, the problems of poor image slimming effect and high cost in the prior art are solved, and more efficient image compression and smoother user experience are achieved.

CN119629359APending Publication Date: 2025-03-14BEIJING BITE YIPAI INFORMATION TECH
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202411773167.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-04
Publication Date
2025-03-14

AI Technical Summary

Technical Problem

In the prior art, the picture slimming effect is poor, the method is single, and the cost of using is high, and the automatic slimming interface and multi-dimensional slimming skills are lacking.

Method used

Provides JAVA-based picture slimming technology methods, including image selection, basic processing, quality setting, format conversion, source information clearing and file storage, and achieves multi-dimensional picture slimming through these steps.

Benefits of technology

While ensuring image clarity, it significantly reduces the image storage size, improves page loading speed, reduces operational costs, and improves user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119629359A_ABST
    Figure CN119629359A_ABST
Patent Text Reader

Abstract

The invention provides a slimming technical method based on a JAVA picture. The method comprises the following operation steps: S1, selecting a picture; s2, basic processing of the picture: carrying out basic processing on the picture by using a JAVA technology; s3, setting picture quality, and controlling the picture quality by using a JAVA technology; s4, picture format conversion: performing format conversion on the picture by using a JAVA technology; s5, picture source information is cleared, the source information of the picture is analyzed through the JAVA technology, and any EXIF information is removed; s6, previewing the image; s7, judging whether the requirement is met or not, judging whether the preview image in the step S6 meets the requirement or not, if yes, executing the step S8, and if not, executing the step S2; and S8, storing the file. According to the method, the storage size of the picture is reduced as much as possible while the definition of the picture is guaranteed, the picture is loaded at the fastest speed, the minimum flow and the minimum storage, the user experience is improved, the picture slimming effect can be improved, and the picture slimming cost is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of picture slimming, and in particular to a JAVA-based picture slimming technical method. Background Art

[0002] JAVA is an object-oriented programming language. It not only absorbs the advantages of C++, but also abandons the difficult-to-understand concepts of multiple inheritance and pointers in C++. Therefore, JAVA has two characteristics: powerful functions and simple and easy to use. As a representative of static object-oriented programming languages, JAVA language has excellently implemented object-oriented theory, allowing programmers to perform complex programming with an elegant way of thinking. JAVA has the characteristics of simplicity, object-oriented, distributed, robust, secure, platform-independent and portable, multi-threaded, and dynamic. JAVA can be used to write desktop applications, Web applications, distributed systems, and embedded system applications.

[0003] In the digital media era, the choice of image format is crucial for optimizing web page performance, reducing bandwidth consumption and improving user experience. Under the condition of ensuring image clarity, the smaller the image storage size, the faster the image loading speed. In the authorized Chinese invention patent "Announcement No.: CN117440172B, Name: A method and device for image compression", it uses a recognition model to identify the content and type of information of the image to be processed, and based on the content and type information, uses an image generation model to generate an image that meets the first image size threshold. The generated image is not only reduced in size but also restores all the information of the original image. However, in the above application and the prior art, no similar interface service is provided for automatic image slimming, and there is a lack of image slimming techniques in various dimensions. The slimming effect is poor, the slimming method is relatively single, and the existing image slimming tools have a high cost of use. Most of the tools on the market are paid tools, which require users to open a membership to operate. Summary of the invention

[0004] The technical problem to be solved by the present invention is to overcome the defects of the prior art in that the weight loss effect is poor, the method is single and the use cost is high, and a JAVA-based picture weight loss technology method is provided.

[0005] The present invention solves the above technical problems through the following technical solutions:

[0006] The present invention provides a JAVA-based image slimming technology method, which includes the following steps:

[0007] S1, picture selection, selecting pictures that need to be slimmed down from the picture library data;

[0008] S2. Basic image processing: use JAVA technology to perform basic image processing;

[0009] S3, picture quality setting, use JAVA technology to control the picture quality;

[0010] S4, picture format conversion, use JAVA technology to convert the picture format;

[0011] S5. Clear the image source information, use JAVA technology to analyze the image source information, and remove any EXIF ​​information;

[0012] S6, a preview image, after being processed in the above steps, a preview image of the image is generated;

[0013] S7: Whether the requirements are met, judging whether the preview image in step S6 meets the requirements, if yes, executing step S8, if not, executing step S2;

[0014] S8, file storage, storing the preview images that meet the requirements into the file storage system.

[0015] In this technical solution, while ensuring the clarity of the image, the storage size of the image is reduced as much as possible, so that the image can be loaded at the fastest speed, with the smallest traffic and the smallest storage, thereby improving the user experience, thereby improving the image slimming effect and reducing the image slimming cost.

[0016] Preferably, the basic processing of the image in step S2 includes setting the width and height, compression ratio, and rotation angle.

[0017] In this technical solution, basic image processing is used to crop the image.

[0018] Preferably, the quality of the picture in step S3 is set to set a suitable picture quality size, and select a suitable picture quality parameter while ensuring picture clarity.

[0019] In this technical solution, the quality parameters of the picture are set.

[0020] Preferably, the format conversion rules of the pictures in step S4 are: jpg / png to webp format, jpg / png to AVIF format, WEBP to jpg / png, and avif format to jpg / png.

[0021] In this technical solution, the formats into which images can be converted are confirmed.

[0022] Preferably, the image source information in step S5 is EXIF ​​information.

[0023] In this technical solution, the attributes of the image source information are confirmed.

[0024] Preferably, the principle of clearing any EXIF ​​information in step S5 is that the clearing does not affect the image display.

[0025] In this technical solution, the principle of clearing EXIF ​​information is confirmed.

[0026] Preferably, in step S6, a user interface is provided to enable the user to view the changes in the image before and after the change and the compression ratio.

[0027] In this technical solution, confirm how to view the preview image.

[0028] Preferably, the specific operation steps of clearing the image source information in step S5 are:

[0029] A1. Source information analysis: analyzing the types and items of image source information;

[0030] A2. Clear source information. Select any source information you want to clear.

[0031] In this technical solution, the specific operation steps for clearing the image source information are confirmed.

[0032] Preferably, the setting of the width and height is to set the height and width of the picture, and crop the picture according to the set height and width.

[0033] In this technical solution, the content of setting the width and height is confirmed.

[0034] Preferably, the compression ratio is to scale the image with the same aspect ratio.

[0035] In this technical solution, the content of the compression ratio is confirmed.

[0036] On the basis of being in accordance with the common sense in the art, the above-mentioned preferred conditions can be arbitrarily combined to obtain the preferred embodiments of the present invention.

[0037] The positive and progressive effects of the present invention are:

[0038] The present invention can significantly improve the page loading speed, especially when the network environment is complex or the user is browsing on a mobile terminal, the fast loading speed can reduce the user's waiting time and improve the user experience;

[0039] When storing and transmitting a large number of images, the images after slimming down take up less storage space and bandwidth resources, which directly reduces the operating costs of enterprises. The images after slimming down reduce the file size while maintaining visual quality. Users can enjoy a smoother browsing experience during use, especially on image-intensive websites or applications. Optimized image processing can reduce page freezes and delays;

[0040] Fast loading and high-quality images can attract users to stay longer and increase user engagement on your website or app, which may increase conversion rates and user loyalty. BRIEF DESCRIPTION OF THE DRAWINGS

[0041] Figure 1 The figure is a schematic diagram of the overall process of the JAVA-based image slimming technology method according to an embodiment of the present invention.

[0042] Figure 2 for Figure 1 The flowchart of clearing image source information based on the JAVA image slimming technology method is shown.

[0043] Figure 3 for Figure 1 The flowchart of converting video to GIF image based on JAVA image slimming technology is shown. DETAILED DESCRIPTION

[0044] The present invention is further described below by way of examples, but the present invention is not limited to the scope of the examples.

[0045] Figure 1 to Figure 2 The structure diagram of an embodiment of the present invention based on the JAVA picture slimming technology method is shown. The method based on the JAVA picture slimming technology method comprises the following steps:

[0046] S1, picture selection, selecting pictures that need to be slimmed down from the picture library data;

[0047] S2. Basic image processing: use JAVA technology to perform basic image processing;

[0048] S3, picture quality setting, use JAVA technology to control the picture quality;

[0049] S4, picture format conversion, use JAVA technology to convert the picture format;

[0050] S5. Clear the image source information, use JAVA technology to analyze the image source information, and remove any EXIF ​​information;

[0051] S6, a preview image, after being processed in the above steps, a preview image of the image is generated;

[0052] S7: Whether the requirements are met, judging whether the preview image in step S6 meets the requirements, if yes, executing step S8, if not, executing step S2;

[0053] S8, file storage, storing the preview images that meet the requirements into the file storage system.

[0054] In this technical solution, while ensuring the clarity of the image, the storage size of the image is reduced as much as possible, so that the image can be loaded at the fastest speed, with the smallest traffic and the smallest storage, thereby improving the user experience, thereby improving the image slimming effect and reducing the image slimming cost.

[0055] The basic processing of the image in step S2 includes setting the width and height, compression ratio, and rotation angle.

[0056] In this technical solution, basic image processing is used to crop the image.

[0057] The quality of the picture in step S3 is set to set a suitable picture quality size, and select a suitable picture quality parameter while ensuring the clarity of the picture.

[0058] In this technical solution, the quality parameters of the picture are set.

[0059] Use JAVA technology to control the image quality. Users can set any image quality to change the storage size of the image.

[0060] The format conversion rules of the pictures in step S4 are: jpg / png to webp format, jpg / png to AVIF format, WEBP to jpg / png, and avif format to jpg / png.

[0061] In this technical solution, the formats into which images can be converted are confirmed.

[0062] The full name of jpg is JPEG, which is a picture format. JPEG pictures store single bitmaps in 24-bit color. JPEG is a platform-independent format that supports the highest level of compression. However, this compression is lossy. Progressive JPEG files support interlacing.

[0063] PNG is an image file storage format, which aims to replace GIF and TIFF file formats, while adding some features that GIF file formats do not have. Portable Network Graphics Format (PNG) is a bitmap file storage format;

[0064] When PNG is used to store grayscale images, the depth of grayscale images can be up to 16 bits. When storing color images, the depth of color images can be up to 48 bits, and up to 16 bits of alpha channel data can be stored. PNG uses a lossless data compression algorithm derived from LZ77. It is generally used in JAVA programs, web pages or S60 programs because of its high compression ratio and small file size.

[0065] The characteristics of PNG are:

[0066] Small size. Due to bandwidth constraints in network communications, it is impossible to use large bmp and jpg files on a large scale on web pages while ensuring that the images are clear and realistic.

[0067] Lossless compression, PNG files are compressed using a derivative of the LZ77 algorithm, resulting in a high compression ratio without data loss. It uses a special encoding method to mark repeated data, so it has no effect on the color of the image and is unlikely to cause color loss, so it can be saved repeatedly without reducing image quality;

[0068] Indexed color mode, PNG-8 format is similar to GIF images, and also uses an 8-bit palette to convert RGB color images into indexed color images. The image no longer stores the color information of each pixel, but a representative color number selected from the image. Each number corresponds to a color, so the amount of image data is reduced, which is very beneficial to the dissemination of color images;

[0069] More optimized network transmission display, PNG images are streamed on the browser, even if the interlaced image will provide the viewer with a basic image content before it is completely downloaded, and then gradually become clearer. It allows continuous reading and writing of image data, which is very suitable for displaying and generating images during communication;

[0070] Supports transparency effects. PNG can define 256 transparency levels for the original image, so that the edge of the color image can blend smoothly with any background, thus completely eliminating jagged edges. This function is not available in GIF and JPEG;

[0071] PNG also supports alpha channel transparency for truecolor and grayscale images.

[0072] A PNG image format file (or data stream) consists of an 8-byte PNG file signature field and more than three data chunks organized in a specific structure.

[0073] Webp is an image file format that provides both lossy and lossless compression (reversible compression). It is derived from the image coding format VP8 and is considered to be a sister project of the WebM multimedia format. It was developed by Google after purchasing On2Technologies and released under the BSD license terms.

[0074] The maximum number of pixels supported by WebP is 16383x16383. Lossy WebP only supports 8-bit YUV4:2:0 format, while lossless (reversible) WebP supports VP8L encoding and 8-bit ARGB color space. Both lossy and lossless compression support Alpha transparency channels, ICC color profiles, and XMP annotation data.

[0075] WebP has two modes: static and dynamic. AnimatedWebP supports lossy and lossless compression, ICC color profile, XMP annotation data, and Alpha transparent channel.

[0076] WebP's lossy compression algorithm is based on intra-frame coding in the VP8 video format, and uses RIFF as the container format. Therefore, it is a block-based conversion scheme with an eight-bit color depth and a luminance-chrominance model (YCbCr4:2:0) with chroma subsampling at a ratio of 1:2. Without content, the RIFF container requires only 20 bytes of overhead and can still save additional metadata. The side length of a WebP image is limited to 16383 pixels.

[0077] WebP is based on block prediction. Each block is predicted based on the values ​​of the three blocks above it and the value of the block to its left (block decoding is done in raster scan order: from left to right, from top to bottom). There are four basic modes of block prediction: horizontal, vertical, DC (monochrome), and TrueMotion. Discrete cosine transform or Walsh-Hadamard transform is used to compress mispredicted data and unpredicted blocks in 4×4 pixel sub-blocks. Both conversions are done using fixed-point arithmetic to avoid rounding errors. The output is compressed using entropy coding. WebP also explicitly supports parallel decoding.

[0078] AVIF is an image file format based on AV1 video coding technology, developed by the Alliance for Open Media (AOMedia)123. The full name of AVIF format is AV1 Image File Format. It uses the AV1 compression algorithm to reduce image size and provide more efficient data compression. AVIF format supports a variety of features, such as HDR (high dynamic range), lossless and lossy compression, different color spaces, film grain, chroma subsampling, etc.

[0079] The characteristics of AVIF format are:

[0080] Efficient compression: AVIF can provide higher or equal compression rates than traditional image formats such as JPEG and WebP while maintaining high image quality58;

[0081] Wide compatibility: With the increasing support of major browsers and operating systems, the compatibility and popularity of AVIF format are rapidly increasing. Currently, mainstream browsers including Google Chrome, Mozilla Firefox, and Microsoft Edge all support the display of AVIF format59;

[0082] Dynamic range and color space support, AVIF supports not only standard SDR (standard dynamic range) images, but also HDR (high dynamic range) images, as well as multiple color spaces such as sRGB, AdobeRGB, ProPhotoRGB, etc. 510;

[0083] Animation support. The AVIF format also supports animated images, similar to the GIF format, but generally provides higher compression and better image quality.

[0084] The image source information in step S5 is EXIF ​​information.

[0085] In this technical solution, the attributes of the image source information are confirmed.

[0086] EXIF information, short for Exchangeable Image File, is specially set for photos taken with digital cameras. It can record the attribute information and shooting data of digital photos.

[0087] EXIF can be attached to JPEG, TIFF, RIFF and other files to add content related to the digital camera shooting information and index map or version information of the image processing software.

[0088] The principle of clearing any EXIF ​​information in step S5 is that the picture display is not affected when clearing.

[0089] In this technical solution, the principle of clearing EXIF ​​information is confirmed.

[0090] In step S6, a user interface is provided to enable the user to view the image changes before and after the change and the compression ratio.

[0091] In this technical solution, confirm how to view the preview image.

[0092] The specific operation steps for clearing the image source information in step S5 are as follows:

[0093] A1. Source information analysis: analyzing the types and items of image source information;

[0094] A2. Clear source information. Select any source information you want to clear.

[0095] In this technical solution, the specific operation steps for clearing the image source information are confirmed.

[0096] When in use, JAVA technology is used to analyze the source information of the image, and support removal of specified EXIF ​​information to reduce the storage size of the image.

[0097] The setting of the width and height is to set the height and width of the picture, and the picture is cropped according to the set height and width.

[0098] In this technical solution, the content of setting the width and height is confirmed.

[0099] The compression ratio is to scale the image with the same aspect ratio.

[0100] In this technical solution, the content of the compression ratio is confirmed.

[0101] Based on the image slimming technology of the present invention, the process of converting a video to a GIF image is as follows:

[0102] Step 1: Video frame decomposition processing: select a video from the video library and perform frame decomposition processing on the video;

[0103] Step 2: image slimming processing, performing slimming processing on the image after the frame decomposition processing in step 1;

[0104] Step 3: GIF setting: set the image after slimming in step 2 as GIF;

[0105] Step 4: Synthesize GIF: Synthesize the picture after GIF setting in step 3 into GIF;

[0106] Step 5: File storage: the GIF synthesized in step 4 is stored in a file storage system.

[0107] The image slimming process in step 2 includes basic image processing, image format conversion, image quality setting and image source information clearing.

[0108] The GIF setting in step three includes compression rules and frame rate setting processing.

[0109] GIF is an image file format. The data of a GIF file is a continuous tone lossless compression format based on the LZW algorithm. Its compression rate is generally around 50%. It does not belong to any application. Currently, almost all related software supports it. There are a large number of software in the public domain that use GIF image files.

[0110] The data of GIF image files are compressed, and a variable length compression algorithm is used. Another feature of GIF format is that it can store multiple color images in one GIF file. If the data of multiple images stored in a file are read out one by one and displayed on the screen, a simplest animation can be formed.

[0111] GIF uses lossless compression technology. As long as the image has no more than 256 colors, it can reduce the file size and maintain the image quality. However, the 256-color limit greatly limits the application scope of GIF files, such as color cameras. On the other hand, the JPG format, which performs well in high-color images, has unsatisfactory effects on simple broken lines. Therefore, the GIF format is generally suitable for charts, buttons, and other images that only require a small number of colors.

[0112] Although the specific embodiments of the present invention are described above, it should be understood by those skilled in the art that this is only for illustration and the protection scope of the present invention is defined by the appended claims. Those skilled in the art may make various changes or modifications to these embodiments without departing from the principles and essence of the present invention, but these changes and modifications all fall within the protection scope of the present invention.

Claims

1. A JAVA-based image slimming technology method, characterized by: The method comprises the following steps: S1, picture selection, selecting pictures that need to be slimmed down from the picture library data; S2. Basic image processing: use JAVA technology to perform basic image processing; S3, picture quality setting, use JAVA technology to control the picture quality; S4, picture format conversion, use JAVA technology to convert the picture format; S5. Clear the image source information, use JAVA technology to analyze the image source information, and remove any EXIF ​​information; S6, a preview image, after being processed in the above steps, a preview image of the image is generated; S7: Whether the requirements are met, judging whether the preview image in step S6 meets the requirements, if yes, executing step S8, if not, executing step S2; S8, file storage, storing the preview images that meet the requirements into the file storage system.

2. The JAVA-based image slimming technology method as claimed in claim 1, characterized in that: The basic processing of the image in step S2 includes setting the width and height, compression ratio, and rotation angle.

3. The JAVA-based image slimming technology method as claimed in claim 1, characterized in that: The quality of the picture in step S3 is set to set a suitable picture quality size, and select a suitable picture quality parameter while ensuring the clarity of the picture.

4. The JAVA-based image slimming technology method as claimed in claim 1, characterized in that: The format conversion rules of the pictures in step S4 are: jpg / png to webp format, jpg / png to AVIF format, WEBP to jpg / png, and avif format to jpg / png.

5. The JAVA-based image slimming technology method as claimed in claim 1, characterized in that: The image source information in step S5 is EXIF ​​information.

6. The JAVA-based image slimming technology method as claimed in claim 1, characterized in that: The principle of clearing any EXIF ​​information in step S5 is that the picture display is not affected when clearing.

7. The JAVA-based image slimming technology method according to claim 1, characterized in that: In step S6, a user interface is provided to enable the user to view the image changes before and after the change and the compression ratio.

8. The JAVA-based image slimming technology method according to claim 1, characterized in that: The specific operation steps for clearing the image source information in step S5 are as follows: A1. Source information analysis: analyzing the types and items of image source information; A2. Clear source information. Select any source information you want to clear.

9. The JAVA-based image slimming technology method as claimed in claim 2, characterized in that: The setting of the width and height is to set the height and width of the picture, and the picture is cropped according to the set height and width.

10. The JAVA-based image slimming technology method according to claim 2, characterized in that: The compression ratio is to scale the image with the same aspect ratio.

Citation Information

Patent Citations

  • Image compression method and device

    CN117440172B