Method and device for compressing image, and electronic device
AssigneeBeijing Kingsoft Internet Security Software Co., Ltd.
InventorBin Bai
Life of this patent
Estimating the term…
Abstract
The present disclosure provides a method and a device for compressing an image, and an electronic device. The method includes: acquiring a resolution of the display screen and a resolution of an image to be compressed; detecting whether the resolution of the image to be compressed is greater than the resolution of the display screen; and when the resolution of the image to be compressed is greater than the resolution of the display screen, compressing the resolution of the image to be compressed to a target resolution according to the resolution of the display screen, a difference between the target resolution and the resolution of the display screen being within a preset resolution range.
Claims17
A method for compressing an image, applicable in an electronic device with a display screen, comprising:
- acquiring a resolution of the display screen and a resolution of the image to be compressed;
- detecting whether the resolution of the image to be compressed is greater than the resolution of the display screen;
- when the resolution of the image to be compressed is greater than the resolution of the display screen, compressing the resolution of the image to be compressed to a target resolution according to the resolution of the display screen, a difference between the target resolution and the resolution of the display screen being within a preset resolution range;
- acquiring a type of an image compressed by the electronic device in a preset time period;
- detecting whether there is an uncompressed image matching with the type in images stored in the electronic device;
- and
- selecting the uncompressed image matching with the type as the image to be compressed when there is the uncompressed image matching with the type in the images stored in the electronic device.
A device for compressing an image, disposed on an electronic device configured with a display screen, comprising:
- a processor;
- and
- a memory, configured to store a computer program comprising program instructions;
- wherein the processor is configured to:
- acquire a resolution of the display screen and a resolution of the image to be compressed;
- detect whether the resolution of the image to be compressed is greater than the resolution of the display screen;
- compress the resolution of the image to be compressed to a target resolution according to the resolution of the display screen when the resolution of the image to be compressed is greater than the resolution of the display screen, a difference between the target resolution and the resolution of the display screen being within a preset resolution range;
- acquire a type of an image compressed by the electronic device in a preset time period;
- detect whether there is an uncompressed image matching with the type in images stored in the electronic device;
- and
- select the uncompressed image matching with the type as the image to be compressed when there is the uncompressed image matching with the type in the images stored in the electronic device.
An electronic device, comprising a housing, a processor, a memory, a display screen, a circuit board and a power supply circuit, wherein,
- the circuit board is disposed in a space enclosed by the housing;
- the processor and the memory are positioned on the circuit board;
- the display screen is externally embedded on the housing and connected with the circuit board;
- the power supply circuit is configured to provide power for respective circuits or components of the electronic device;
- the memory is configured to store executable program codes and data;
- the processor is configured to run a program corresponding to the executable program codes by reading the executable program codes stored in the memory, to perform following operations:
- acquiring a resolution of the display screen and a resolution of an image to be compressed;
- detecting whether the resolution of the image to be compressed is greater than the resolution of the display screen;
- when the resolution of the image to be compressed is greater than the resolution of the display screen, compressing the resolution of the image to be compressed to a target resolution according to the resolution of the display screen, a difference between the target resolution and the resolution of the display screen being within a preset resolution range;
- acquiring a type of an image compressed by the electronic device in a preset time period;
- detecting whether there is an uncompressed image matching with the type in images stored in the electronic device;
- and
- selecting the uncompressed image matching with the type as the image to be compressed when there is the uncompressed image matching with the type in the images stored in the electronic device.
Dependencies are inferred from the claim text.