CN114627197A - Image file optimization method and related equipment thereof - Google Patents

Image file optimization method and related equipment thereof Download PDF

Info

Publication number
CN114627197A
CN114627197A CN202210230296.0A CN202210230296A CN114627197A CN 114627197 A CN114627197 A CN 114627197A CN 202210230296 A CN202210230296 A CN 202210230296A CN 114627197 A CN114627197 A CN 114627197A
Authority
CN
China
Prior art keywords
image file
target image
optimization
file
target
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210230296.0A
Other languages
Chinese (zh)
Inventor
王国彬
牟锟伦
彭军
桂湘波
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tubatu Group Co Ltd
Original Assignee
Tubatu Group Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Tubatu Group Co Ltd filed Critical Tubatu Group Co Ltd
Priority to CN202210230296.0A priority Critical patent/CN114627197A/en
Publication of CN114627197A publication Critical patent/CN114627197A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T9/00Image coding
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/16File or folder operations, e.g. details of user interfaces specifically adapted to file systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/17Details of further file system functions
    • G06F16/1737Details of further file system functions for reducing power consumption or coping with limited storage space, e.g. in mobile devices
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/50Information retrieval; Database structures therefor; File system structures therefor of still image data
    • G06F16/51Indexing; Data structures therefor; Storage structures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/50Information retrieval; Database structures therefor; File system structures therefor of still image data
    • G06F16/56Information retrieval; Database structures therefor; File system structures therefor of still image data having vectorial format
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/61Installation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2210/00Indexing scheme for image generation or computer graphics
    • G06T2210/32Image data format
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2210/00Indexing scheme for image generation or computer graphics
    • G06T2210/62Semi-transparency

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Software Systems (AREA)
  • Human Computer Interaction (AREA)
  • Multimedia (AREA)
  • Processing Or Creating Images (AREA)

Abstract

The application provides an image file optimization method, which comprises the following steps: determining a target file path; acquiring a target image file under a target file path; judging whether the target image file meets an optimization condition; and if the target image file meets the optimization condition, optimizing the target image file to obtain an optimized image file, wherein the file size of the optimized image file is smaller than that of the target image file. By the method, the file volume of the finally obtained optimized image file is smaller, so that the installation package volume of the application program is reduced, the requirements of developers are met, meanwhile, the work of the developers is reduced, and the practicability of the method is improved.

Description

Image file optimization method and related equipment thereof
Technical Field
The present application relates to the field of image processing, and in particular, to an image file optimization method and related devices.
Background
The method is limited by the storage capacity of the mobile device in the research and development process of the application program of the mobile device, and the application program is often required to be optimized and slimmed, namely, the size of an application program installation package is reduced through adjustment of a certain means, and controls occupied by the application program in the mobile device are reduced, so that the usability of the application program is ensured.
The most important work in the process of optimizing the installation package is to reduce the size of the picture resource file in the installation package, so as to reduce the size of the whole installation package file.
The developer needs to convert the picture files in a manual mode, all resource files of the project need to be manually searched in the process, the resource files needing to be slimmed are manually screened out, the workload in the process is increased along with the increase of the picture files, and the efficiency of the development process is reduced.
Disclosure of Invention
The invention aims to provide an image file optimization method, which aims to solve the problem that the workload is overlarge because a developer needs to convert an image file manually in the prior art, and the method comprises the following steps:
a first aspect of an embodiment of the present application provides an image file optimization method, including:
determining a target file path;
acquiring a target image file under a target file path;
judging whether the target image file meets an optimization condition;
and if the target image file meets the optimization condition, optimizing the target image file to obtain an optimized image file, wherein the file size of the optimized image file is smaller than that of the target image file.
Based on the image file optimization method provided by the first aspect of the embodiments of the present application, optionally,
the optimization conditions comprise a first optimization condition, a second optimization condition and a third optimization condition:
if the target image file meets the optimization condition, optimizing the target image file, including:
if the target image file meets the first optimization condition, performing first optimization processing on the target image file;
if the target image file meets the second optimization condition, performing second optimization processing on the target image file;
and if the target image file meets the third optimization condition, performing third optimization processing on the target image file.
Based on the image file optimization method provided in the first aspect of the embodiment of the present application, optionally, the first optimization condition includes: the target image file has transparent color values, and the transparent color values are all maximum values;
the first optimization process includes: and converting the target image file into a joint image expert group format.
Based on the image file optimization method provided in the first aspect of the embodiment of the present application, optionally, the second optimization condition includes: the shape of the target image file is a standard shape, and the color of the target image file is a pure color or a gradient color;
the second optimization process includes: and converting the target image file into an extensible markup language format.
Based on the image file optimization method provided in the first aspect of the embodiment of the present application, optionally, the third optimization condition includes: the color of the target image file is pure, and the shape of the target image file meets the preset requirement;
the third optimization process includes: converting the target image file to a scalable vector graphics format.
Based on the image file optimization method provided in the first aspect of the embodiment of the present application, optionally, the method further includes:
displaying relevant information of the target image file and the optimized image file, wherein the relevant information comprises file size information and file name information of the target image file and the optimized image file;
and storing the optimized image file according to the selection of the user.
Based on the image file optimization method provided in the first aspect of the embodiment of the present application, optionally, after the target image file is optimized to obtain an optimized image file, the method further includes:
and sending an optimization completion notice to a user.
A second aspect of the embodiments of the present application provides an image file optimization apparatus, including:
a determining unit, configured to determine a target file path;
the acquisition unit is used for acquiring a target image file under a target file path;
the judging unit is used for judging whether the target image file meets the optimization condition;
and the optimization unit is used for optimizing the target image file to obtain an optimized image file if the target image file meets the optimization condition, wherein the file size of the optimized image file is smaller than that of the target image file.
A third aspect of the embodiments of the present application provides an image file optimization apparatus, including:
the system comprises a central processing unit, a memory, an input/output interface, a wired or wireless network interface and a power supply;
the memory is a transient memory or a persistent memory;
the central processing unit is configured to communicate with the memory, and to execute the instruction operations in the memory on the device to perform the method according to any one of the first aspect of the embodiments of the present application.
A fourth aspect of embodiments of the present application provides a computer-readable storage medium, including instructions, which, when executed on a computer, cause the computer to perform the method according to any one of the first aspect of embodiments of the present application.
A fifth aspect of embodiments of the present application provides a computer program product containing instructions, which when executed on a computer, cause the computer to perform the method according to any one of the first aspect of embodiments of the present application.
According to the technical scheme, the embodiment of the application has the following advantages: the application provides an image file optimization method, which comprises the following steps: determining a target file path; acquiring a target image file under a target file path; judging whether the target image file meets an optimization condition; and if the target image file meets the optimization condition, optimizing the target image file to obtain an optimized image file, wherein the file size of the optimized image file is smaller than that of the target image file. By the method, the file volume of the finally obtained optimized image file is smaller, so that the installation package volume of the application program is reduced, the requirements of developers are met, meanwhile, the work of the developers is reduced, and the practicability of the method is improved.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings needed to be used in the description of the embodiments or the prior art will be briefly introduced below, it is obvious that the drawings in the following description are only embodiments of the present application, and for those skilled in the art, other drawings can be obtained according to the provided drawings without creative efforts. It is to be understood that the drawings provided in this section are only for the purpose of better understanding of the present solution and are not to be construed as limiting the present application.
Fig. 1 is a schematic flowchart of an embodiment of an image file optimization method provided in the present application.
Fig. 2 is another schematic flow chart of an embodiment of an image file optimization method provided in the present application.
Fig. 3 is a schematic structural diagram of an embodiment of an image file optimization apparatus provided in the present application.
Fig. 4 is another schematic structural diagram of an embodiment of an image file optimization apparatus provided in the present application.
Detailed Description
In order to make the technical solutions of the embodiments of the present application better understood, the technical solutions in the embodiments of the present application are clearly and completely described below, and it is obvious that the described embodiments are only some embodiments of the present application, and not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application. Meanwhile, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness of description.
The terms "first," "second," "third," "fourth," and the like in the description and in the claims of the present application and in the drawings described above, if any, are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It will be appreciated that the data so used may be interchanged under appropriate circumstances such that the embodiments described herein may be practiced otherwise than as specifically illustrated or described herein. Moreover, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
The method is limited by the storage capacity of the mobile device in the research and development process of the application program of the mobile device, and the application program is often required to be optimized and slimmed, namely, the size of an application program installation package is reduced through adjustment of a certain means, and controls occupied by the application program in the mobile device are reduced, so that the usability of the application program is ensured.
The most important work in the process of optimizing the installation package is to reduce the size of the picture resource file in the installation package, so as to reduce the size of the whole installation package file.
A developer needs to convert the picture files in a manual mode, all resource files of a project need to be retrieved manually in the process, the resource files needing to be slimmed are screened out manually, the workload in the process is increased along with the increase of the picture files, and the efficiency of a development process is reduced.
To solve the above problem, an embodiment of the present application provides a method for optimizing a picture file, and specifically, referring to fig. 1, an embodiment of the method for optimizing a picture file provided by the present application includes: step 101-step 104.
101. And determining a target file path.
Specifically, a target file path is determined, where the target file path is a path address where the target image file is located, and a user may determine the target file path by selecting a specific folder. The target file path may be a path of the application program installation package, and is not limited herein.
102. And acquiring a target image file under the target file path.
Specifically, a target image file in a target file path is obtained. The server scans the files under the path of the target file to obtain the target image file, wherein the format of the target image file is determined according to the user setting, the user can select various different image file formats as conditions, and further obtain all the image files under the path of the target file as the target image file, the number of the target image files is not limited in the actual implementation process, and the optimization of all the image files under the path of the target file is performed as far as possible by obtaining the image files of various different formats, it can be understood that the user can also obtain the target image file under the path of the target file by setting a certain screening condition in the actual implementation process, specifically, if the files of all PNG (Portable Network Graphics) formats can be set as the target image files, the specific form can be determined according to the actual situation, and are not limited herein.
103. And judging whether the target image file meets the optimization condition.
Specifically, whether the target image file meets the optimization condition is judged. After the target image file is obtained, it is necessary to determine whether the target image file meets optimization conditions, specifically, the optimization conditions are preset by a user according to different optimization requirements, the optimization conditions may be multiple, if the target image file meets a certain optimization condition, the optimization may be performed according to relevant settings of the existing conditions, the specific optimization conditions may be determined according to actual situations, and no limitation is made here.
104. And optimizing the target image file to obtain an optimized image file.
Specifically, the target image file is optimized to obtain an optimized image file, and the file size of the optimized image file is smaller than that of the target image file. That is, the target image file is optimized to reduce the file size of the target image file, the optimized image file is the processed file, and the file size is smaller than that of the original target image file, and the optimization processing means adopted in the actual implementation process can include: the specific means of converting the original file into the file format with a smaller size may be determined according to the actual situation, and is not limited herein. The optimized image file obtained after the optimization processing reduces the volume occupied by the image while keeping the information of the original target image file as much as possible.
According to the technical scheme, the embodiment of the application has the following advantages: the application provides an image file optimization method, which comprises the following steps: determining a target file path; acquiring a target image file under a target file path; judging whether the target image file meets an optimization condition; and if the target image file meets the optimization condition, optimizing the target image file to obtain an optimized image file, wherein the file size of the optimized image file is smaller than that of the target image file. By the method, the file volume of the finally obtained optimized image file is smaller, so that the installation package volume of the application program is reduced, the requirements of developers are met, meanwhile, the work of the developers is reduced, and the practicability of the method is improved.
To facilitate the practical use of the method, the present application also provides a more detailed embodiment that can be implemented alternatively, and referring to fig. 2, an embodiment of the image file optimization method provided by the present application includes: step 201-step 209.
201. And determining a target file path.
202. And acquiring a target image file under the target file path.
Specifically, the foregoing steps 201 to 202 are similar to those described in step 101 and step 102 in the embodiment corresponding to fig. 1, and specific reference may be made to the foregoing contents, which are not repeated herein.
203. And judging whether the target image file meets the optimization condition.
Specifically, it is determined whether the target image file meets the optimization condition, specifically, the present embodiment takes the example that the optimization condition includes a first optimization condition, a second optimization condition, and a third optimization condition as an example, specifically,
the first optimization condition includes: the target image file has transparent color values, and the transparent color values are all maximum values; the PNG format file has three conventional color value attributes, and the transparent color value is used for representing the transparency of the image.
The second optimization condition includes: the shape of the target image file is a standard shape, and the color of the target image file is a pure color or a gradient color. This form of the image illustrates that the image is simpler in form and can be represented in a more compact form.
The third optimization conditions include: the color of the target image file is a pure color, the shape of the target image file meets the preset requirement, the shape of the preset requirement of the condition can be the shape of some conventional figures, such as arrows, telephones, short messages, bubbles and the like, and the specific details are not limited herein. The driven image can be slimming in svg format.
In the actual implementation process, information of pure color, gradient color, transparency, picture size, complexity and the like of all target images can be extracted and compared one by one to judge the conditions met by each image.
204. And converting the target image file into a joint image expert group format.
Specifically, if the target image file meets the first optimization condition, the target image file is converted into a joint image experts group (JPG) format.
205. And converting the target image file into an extensible markup language format.
Specifically, if the target image file meets the second optimization condition, the target image file is converted into an extensible markup language (xml) format.
206. Converting the target image file to a scalable vector graphics format
Specifically, if the target image file meets the second optimization condition, the target image file is converted into a scalable vector graphics (svg) format.
207. And displaying the related information of the target image file and the optimized image file.
Specifically, the related information of the target image file and the optimized image file is displayed. After the conversion of the target image file is completed, the related information of the target image file and the optimized image file can be displayed, wherein the related information comprises file size information and file name information of the target image file and the optimized image file, so that a user can compare the size change conditions of the image before and after optimization, and further learn the related information of the optimization process.
208. And storing the optimized image file according to the selection of the user.
Specifically, the optimized image file is stored according to the selection of the user. The user may choose to store the optimized image file in an additional selected folder or in the target file path in place of the original target image file. The specific choice may be determined according to the user, and is not limited herein.
209. And sending an optimization completion notice to a user.
Specifically, an optimization completion notification is sent to the user. The hook function can be configured through a tool, and the optimized result can be informed to a user through IM (instant messaging), mail notification and short message notification after scanning is finished; and simultaneously recording each suboptimal record, and backing up or restoring according to the record.
According to the technical scheme, the embodiment of the application has the following advantages: the application provides an image file optimization method, which comprises the following steps: determining a target file path; acquiring a target image file under a target file path; judging whether the target image file meets an optimization condition; and if the target image file meets the optimization condition, optimizing the target image file to obtain an optimized image file, wherein the file size of the optimized image file is smaller than that of the target image file. By the method, the file volume of the finally obtained optimized image file is smaller, so that the installation package volume of the application program is reduced, the requirements of developers are met, meanwhile, the work of the developers is reduced, and the practicability of the method is improved.
In order to support the implementation of the above embodiments, the present application further provides an image file optimization apparatus, please refer to fig. 3, where an embodiment of the present application includes:
a determining unit 301, configured to determine a target file path;
an obtaining unit 302, configured to obtain a target image file in a target file path;
a judging unit 303, configured to judge whether the target image file meets an optimization condition;
and the optimizing unit 304 is configured to, if the target image file meets the optimization condition, perform optimization processing on the target image file to obtain an optimized image file.
In this embodiment, the flow executed by each unit in the image file optimization device is similar to the method flow described in the embodiment corresponding to fig. 1 or fig. 2, and is not repeated here.
FIG. 4 shows a schematic block diagram of an example electronic device 400 that may be used to implement embodiments of the present application. Electronic devices are intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. The electronic device may also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be examples only, and are not meant to limit implementations of the present application that are described and/or claimed herein.
As shown in fig. 4, the apparatus 400 includes a computing unit 401 that can perform various appropriate actions and processes according to a computer program stored in a Read Only Memory (ROM)402 or a computer program loaded from a storage unit 408 into a Random Access Memory (RAM) 403. In the RAM 403, various programs and data required for the operation of the device 400 can also be stored. The computing unit 401, ROM 402, and RAM 403 are connected to each other via a bus 404. An input/output (I/O) interface 405 is also connected to bus 404.
A number of components in device 400 are connected to I/O interface 405, including: an input unit 406 such as a keyboard, a mouse, or the like; an output unit 407 such as various types of displays, speakers, and the like; a storage unit 408 such as a magnetic disk, optical disk, or the like; and a communication unit 409 such as a network card, modem, wireless communication transceiver, etc. The communication unit 409 allows the device 400 to exchange information/data with other devices via a computer network, such as the internet, and/or various telecommunication networks.
Computing unit 401 may be a variety of general and/or special purpose processing components with processing and computing capabilities. Some examples of the computing unit 401 include, but are not limited to, a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), various dedicated Artificial Intelligence (AI) computing chips, various computing units running machine learning model algorithms, a Digital Signal Processor (DSP), and any suitable processor, controller, microcontroller, and so forth. The calculation unit 401 executes the respective methods and processes described above, such as the image file optimization method. For example, in some embodiments, implemented as a computer software program tangibly embodied in a machine-readable medium, such as storage unit 408. In some embodiments, part or all of the computer program may be loaded and/or installed onto the device 400 via the ROM 402 and/or the communication unit 409. When the computer program is loaded into RAM 403 and executed by computing unit 401, one or more steps of the image file optimization method described above may be performed. Alternatively, in other embodiments, the computing unit 401 may be configured to perform the image file optimization method by any other suitable means (e.g. by means of firmware).
Various implementations of the systems and techniques described here above may be implemented in digital electronic circuitry, integrated circuitry, Field Programmable Gate Arrays (FPGAs), Application Specific Integrated Circuits (ASICs), Application Specific Standard Products (ASSPs), system on a chip (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs that are executable and/or interpretable on a programmable system including at least one programmable processor, which may be special or general purpose, receiving data and instructions from, and transmitting data and instructions to, a storage system, at least one input device, and at least one output device.
Program code for implementing the methods of the present application may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general purpose computer, special purpose computer, or other programmable data processing apparatus, such that the program codes, when executed by the processor or controller, cause the functions/operations specified in the flowchart and/or block diagram to be performed. The program code may execute entirely on the machine, partly on the machine, as a stand-alone software package, partly on the machine and partly on a remote machine or entirely on the remote machine or server.
In the context of this application, a machine-readable medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
To provide for interaction with a user, the systems and techniques described here can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and a pointing device (e.g., a mouse or a trackball) by which a user can provide input to the computer. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form, including acoustic, speech, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a back-end component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such back-end, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), Wide Area Networks (WANs), the internet, and blockchain networks.
The computer system may include clients and servers. A client and server are generally remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. The Server can be a cloud Server, also called a cloud computing Server or a cloud host, and is a host product in a cloud computing service system, so as to solve the defects of high management difficulty and weak service expansibility in the traditional physical host and VPS service ("Virtual Private Server", or simply "VPS"). The server may also be a server of a distributed system, or a server incorporating a blockchain.
The embodiment of the application also provides a computer storage medium, which is used for storing computer software instructions for the image file optimization method and comprises a program for executing the image file optimization method.
The image file optimization method may be as described above for fig. 1.
An embodiment of the present application further provides a computer program product, where the computer program product includes computer software instructions, and the computer software instructions can be loaded by a processor to implement the flow of the image file optimization method in any one of fig. 1 and fig. 2.
In the several embodiments provided in the present application, it should be understood that the disclosed system, apparatus and method may be implemented in other manners. For example, the above-described embodiments of the apparatus are merely illustrative, and for example, equivalent circuit transformations, partitions of units, and logic functions may be merely one type of partitioning, and in actual implementation, there may be other partitioning manners, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The above description is only for the purpose of illustrating the preferred embodiments of the present invention and is not to be construed as limiting the invention, and any modifications, equivalents or improvements made within the spirit and principle of the present invention should be included in the scope of the present invention.

Claims (10)

1. An image file optimization method, comprising:
determining a target file path;
acquiring a target image file under a target file path;
judging whether the target image file meets an optimization condition;
and if the target image file meets the optimization condition, optimizing the target image file to obtain an optimized image file, wherein the file size of the optimized image file is smaller than that of the target image file.
2. The image file optimizing method according to claim 1,
the optimization conditions comprise a first optimization condition, a second optimization condition and a third optimization condition:
if the target image file meets the optimization condition, optimizing the target image file, including:
if the target image file meets the first optimization condition, performing first optimization processing on the target image file;
if the target image file meets the second optimization condition, performing second optimization processing on the target image file;
and if the target image file meets the third optimization condition, performing third optimization processing on the target image file.
3. The image file optimization method according to claim 2, wherein the first optimization condition includes: the target image file has transparent color values, and the transparent color values are all maximum values;
the first optimization process includes: and converting the target image file into a joint image expert group format.
4. The image file optimization method according to claim 2, wherein the second optimization condition includes: the shape of the target image file is a standard shape, and the color of the target image file is a pure color or a gradient color;
the second optimization process includes: and converting the target image file into an extensible markup language format.
5. The image file optimization method according to claim 2, wherein the third optimization condition includes: the color of the target image file is pure, and the shape of the target image file meets the preset requirement;
the third optimization process includes: converting the target image file to a scalable vector graphics format.
6. The image file optimization method of claim 1, further comprising:
displaying related information of the target image file and the optimized image file, wherein the related information comprises file size information and file name information of the target image file and the optimized image file;
and storing the optimized image file according to the selection of the user.
7. The method of claim 1, wherein after the optimizing the target image file to obtain the optimized image file, the method further comprises:
and sending an optimization completion notification to the user.
8. An image file optimizing apparatus, comprising:
a determining unit, configured to determine a target file path;
the acquisition unit is used for acquiring a target image file under a target file path;
the judging unit is used for judging whether the target image file meets the optimization condition;
and the optimization unit is used for optimizing the target image file to obtain an optimized image file if the target image file meets the optimization condition, wherein the file size of the optimized image file is smaller than that of the target image file.
9. An image file optimizing apparatus, comprising:
the system comprises a central processing unit, a memory, an input/output interface, a wired or wireless network interface and a power supply;
the memory is a transient memory or a persistent memory;
the central processing unit is configured to communicate with the memory, and execute the instruction operations in the memory on the image file optimization device to execute the image file optimization method according to any one of the first aspect of the embodiments of the present application.
10. A computer-readable storage medium comprising instructions which, when executed on a computer, cause the computer to perform the method of any one of claims 1 to 7.
CN202210230296.0A 2022-03-10 2022-03-10 Image file optimization method and related equipment thereof Pending CN114627197A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210230296.0A CN114627197A (en) 2022-03-10 2022-03-10 Image file optimization method and related equipment thereof

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210230296.0A CN114627197A (en) 2022-03-10 2022-03-10 Image file optimization method and related equipment thereof

Publications (1)

Publication Number Publication Date
CN114627197A true CN114627197A (en) 2022-06-14

Family

ID=81900968

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210230296.0A Pending CN114627197A (en) 2022-03-10 2022-03-10 Image file optimization method and related equipment thereof

Country Status (1)

Country Link
CN (1) CN114627197A (en)

Similar Documents

Publication Publication Date Title
CN113808231B (en) Information processing method and device, image rendering method and device, and electronic device
CN113392974B (en) Model training method, device, electronic equipment and storage medium
CN112988727B (en) Data annotation method, device, equipment, storage medium and computer program product
CN113722124B (en) Content processing method, device, equipment and storage medium of cloud mobile phone
EP4050867A2 (en) Method and apparatus of synchronizing data, electronic device and storage medium
JP7309811B2 (en) Data annotation method, apparatus, electronics and storage medium
CN113052246A (en) Method and related device for training classification model and image classification
CN114757214B (en) Selection method and related device for sample corpora for optimizing translation model
CN114627197A (en) Image file optimization method and related equipment thereof
CN115643468A (en) Poster generation method and device, electronic equipment and storage medium
CN115115062A (en) Machine learning model establishing method, related device and computer program product
CN113836455A (en) Special effect rendering method, device, equipment, storage medium and computer program product
CN113905040A (en) File transmission method, device, system, equipment and storage medium
CN113554721A (en) Image data format conversion method and device
CN113467737A (en) Method, device and equipment for transmitting picture data and storage medium
CN113361249B (en) Document weight judging method, device, electronic equipment and storage medium
CN117407044A (en) Configuration method, device, equipment and medium of cross-terminal assembly
CN117608704A (en) Declarative component interface parameter acquisition method and system thereof
CN117574868A (en) Chart generation method, device, equipment and storage medium
CN116881121A (en) Test method, test device, electronic equipment and computer readable storage medium
CN117708067A (en) Method for generating APK file, related device and computer program product
CN117032859A (en) Layered development device, method, equipment and medium for UI (user interface) and business application
CN115858891A (en) Visual display method and device of data, electronic equipment and storage medium
CN113342413A (en) Method, apparatus, device, medium and product for processing components
CN117668352A (en) Method, apparatus, device, storage medium and program product for generating landing page

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination