CN114281230A - Background picture generation method, device, medium and equipment suitable for different aspect ratios - Google Patents

Background picture generation method, device, medium and equipment suitable for different aspect ratios Download PDF

Info

Publication number
CN114281230A
CN114281230A CN202111535784.4A CN202111535784A CN114281230A CN 114281230 A CN114281230 A CN 114281230A CN 202111535784 A CN202111535784 A CN 202111535784A CN 114281230 A CN114281230 A CN 114281230A
Authority
CN
China
Prior art keywords
picture
zoomed
target
segment
tail
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
CN202111535784.4A
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.)
Guiyang Yuwan Technology Co ltd
Original Assignee
Guiyang Yuwan Technology 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 Guiyang Yuwan Technology Co ltd filed Critical Guiyang Yuwan Technology Co ltd
Priority to CN202111535784.4A priority Critical patent/CN114281230A/en
Publication of CN114281230A publication Critical patent/CN114281230A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Television Signal Processing For Recording (AREA)
  • Studio Circuits (AREA)

Abstract

The application provides a background picture generation method, a device, a medium and equipment suitable for different aspect ratios, wherein the method comprises the following steps: acquiring a head section picture, a middle section picture and a tail section picture which are obtained based on the division of a basic background picture, wherein a pattern repetition region exists in the middle section of the basic background picture along the target direction, and the continuity of the patterns in the spliced picture is not damaged when two identical middle section pictures are spliced in sequence along the target direction; respectively scaling the head segment picture, the middle segment picture and the tail segment picture in an equal ratio until the size of the head segment picture, the middle segment picture and the tail segment picture in the reference direction is consistent with the size of the target background picture in the reference direction; determining the target number of the middle section pictures needing to be spliced based on the size of the target background picture in the target direction and the sizes of the zoomed head section picture, the zoomed middle section picture and the zoomed tail section picture in the target direction; and splicing the target background picture based on the zoomed head segment picture, the zoomed tail segment picture and the zoomed middle segment pictures of the target quantity.

Description

Background picture generation method, device, medium and equipment suitable for different aspect ratios
Technical Field
The present application relates to the field of image processing technologies, and in particular, to a method, an apparatus, a medium, and a device for generating a background picture suitable for different aspect ratios.
Background
In Android development, a service scene that a background needs to be added to a picture or a text is often encountered, and in most cases, a picture in a PNG format (a picture needs to be stretched in a designated area) can meet the requirement. However, in reality, a service scene is complex, and many backgrounds need to be realized by a developer, for example, some backgrounds with patterns need to be displayed, and when the patterns are stretched more or compressed more (generally, such deformation is recognizable to naked eyes), a larger deformation is generated to affect the beauty.
For such scenarios, the existing solutions are typically the following:
1) clipping the redundant part after scaling;
2) the initial fixed width-to-height ratio of the design uses an equal-ratio background map.
However, the use of the solution of clipping the redundant part after scaling results in incomplete display of the background image; the scheme of fixing the width and the height can not meet the product requirement due to the single width and the height. Then, the user needs to get the second, and the PNG format picture is used, so that the pattern in the stretching area is stretched to generate obvious deformation, and the user experience is very poor; and the use of a pure background has a single visual effect and is difficult to meet the individual requirements.
Disclosure of Invention
An object of the embodiments of the present application is to provide a method, an apparatus, a medium, and a device for generating background pictures suitable for different aspect ratios, where the background pictures are added to scenes with different aspect ratios while reducing the stretching degree as much as possible and without affecting user experience.
In order to achieve the above object, embodiments of the present application are implemented as follows:
in a first aspect, an embodiment of the present application provides a method for generating a background picture applicable to different aspect ratios, including: acquiring a head section picture, a middle section picture and a tail section picture which are obtained based on the division of a basic background picture, wherein the middle section of the basic background picture has a pattern repetition region along a target direction, the target direction is any one direction of the width direction and the height direction of the basic background picture, the middle section picture is part or all of the pattern repetition region, and the continuity of patterns in a spliced picture is not damaged when two identical middle section pictures are sequentially spliced along the target direction; respectively scaling a head segment picture, a middle segment picture and a tail segment picture in an equal ratio mode until the size of the head segment picture, the middle segment picture and the tail segment picture in a reference direction is consistent with the size of a target background picture in the reference direction, wherein the reference direction is the other direction except the target direction in the width direction and the height direction; determining the target number of the middle section pictures needing to be spliced based on the size of the target background picture in the target direction and the sizes of the zoomed head section picture, the zoomed middle section picture and the zoomed tail section picture in the target direction; and splicing the target background picture based on the zoomed head segment picture, the zoomed tail segment picture and the zoomed middle segment pictures of the target quantity.
In the embodiment of the present application, a pattern repetition region exists in the middle section of the basic background picture along the target direction, and the first section picture, the middle section picture (part or all of the pattern repetition region) and the last section picture obtained based on the division of the basic background picture are obtained as the basis for splicing the target background picture (the first section picture, the middle section picture and the last section picture need to be scaled in equal proportion to the size of the target background picture in the reference direction and the size of the target background picture in the reference direction are consistent), and when two identical middle section pictures are sequentially spliced along the target direction, the continuity of the patterns in the spliced pictures is not destroyed, so that the background pictures with different aspect ratios (the target background pictures with different sizes can be spliced in the target direction) can be adapted by splicing the middle section pictures with different numbers, and the continuity of the patterns in the spliced pictures can not be destroyed, therefore, the feeling of the background picture to the user is very smooth and unobtrusive, and the user experience can be ensured. The target number of the middle section pictures to be spliced can be determined by the size of the target background picture in the target direction and the sizes of the zoomed head section picture, the zoomed middle section picture and the zoomed tail section picture in the target direction, thereby splicing the target background picture by utilizing the zoomed head segment picture, the zoomed tail segment picture and the zoomed middle segment pictures of the target quantity, thus, the appropriate number of middle pictures can be reasonably used as much as possible, the size difference required to be compensated when splicing the target background pictures is reduced (for example, each picture can be stretched or compressed), therefore, the stretching deformation can be controlled within a small range (even to the extent of no stretching or compression deformation), and the user can hardly perceive the stretching deformation, so that the method can be well applied to service scenes with different aspect ratio background picture requirements.
With reference to the first aspect, in a first possible implementation manner of the first aspect, acquiring a head segment picture, a middle segment picture, and a tail segment picture obtained based on dividing a base background picture includes: acquiring a basic background picture which needs to be suitable for a target aspect ratio, wherein the aspect ratio of the basic background picture is different from or the same as the target aspect ratio; determining a pattern repetition region in the basic background picture, wherein patterns in the pattern repetition region are periodically repeated along the target direction; dividing the basic background picture into a head picture positioned at one side of the pattern repeating region, a tail picture positioned at the other side of the pattern repeating region and an undetermined picture in which the pattern repeating region is positioned by taking the pattern repeating region as a boundary; and determining the middle section picture based on the undetermined picture.
In the implementation manner, a basic background picture (the aspect ratio of the basic background picture is different from or the same as the target aspect ratio) which needs to be suitable for the target aspect ratio (that is, the aspect ratio of the target background picture) is obtained, a pattern repetition region (a pattern in the region is periodically repeated along the target direction) is determined from the basic background picture, and thus, with the pattern repetition region as a boundary, the basic background picture is divided into a head picture located on one side of the pattern repetition region, a tail picture located on the other side of the pattern repetition region, and an undetermined picture where the pattern repetition region is located, and a middle picture is further determined based on the undetermined picture. In this way, the basic background picture can be divided into a head picture and a tail picture which are not required to be repeatedly spliced and are arranged on two sides, and a middle picture which is required to be repeatedly spliced (determined based on the undetermined picture), so that the spliced target background picture and the provided basic background picture can be ensured to have larger commonality (the head and the tail are respectively the same, and the middle picture has middle pictures with different repetition times according to different aspect ratios), the feeling of a user is not obtrusive, and the user experience can be ensured.
With reference to the first possible implementation manner of the first aspect, in a second possible implementation manner of the first aspect, the determining the middle-segment picture based on the pending picture includes: determining a minimum repeating unit from the pattern repeating area of the picture to be determined, wherein the minimum repeating unit represents that the pattern repeating area extends along the target direction and is repeated by taking the minimum repeating unit as a reference; and dividing a picture containing one minimum repeating unit or a plurality of continuous minimum repeating units from the pending pictures as the middle picture.
In this implementation, a minimum repeating unit is determined from a pattern repeating region of a picture to be determined (the minimum repeating unit is used as a reference for repeating when the pattern repeating region extends along a target direction); and then, dividing a picture containing a minimum repeating unit or a plurality of continuous minimum repeating units from the pending pictures as a middle-segment picture. When a minimum repeating unit is divided to be used as a middle-section picture, the middle-section picture can be adapted to a wider background picture as far as possible; and the pictures of a plurality of continuous minimum repeating units are used as the middle section pictures, so that the workload of splicing the pictures can be increased by selecting the middle section pictures with smaller sizes when the sizes of the head section pictures and the tail section pictures in the target direction are far larger than those of the middle section pictures, and the efficiency of splicing the pictures is effectively improved by using the pictures of the plurality of continuous minimum repeating units as the middle section pictures.
With reference to the first aspect, in a third possible implementation manner of the first aspect, determining a target number of middle section pictures to be spliced based on a size of a target background picture in the target direction, and sizes of a zoomed head section picture, a zoomed middle section picture, and a zoomed tail section picture in the target direction includes: calculating the target number of the middle section pictures needing to be spliced by using the following rounding formula:
centerImageCount=(bllh-th-bh)/ch,
wherein the centerImageCount represents a target number, bllh represents a size of the target background picture in the target direction, th represents a size of the zoomed head segment picture in the target direction, ch represents a size of the zoomed middle segment picture in the target direction, and bh represents a size of the zoomed tail segment picture in the target direction.
In the implementation mode, the target number of the middle section pictures to be spliced is calculated by using the provided rounding formula, and the target number of the middle section pictures to be spliced can be simply and reliably determined.
With reference to the third possible implementation manner of the first aspect, in a fourth possible implementation manner of the first aspect, splicing the target background picture based on the zoomed head segment picture, the zoomed tail segment picture, and the zoomed middle segment pictures of the target number includes: calculating the residual size to be compensated by splicing the zoomed head segment picture and the zoomed tail segment picture and the zoomed middle segment pictures of the target number with the zoomed middle segment pictures by using the following complementary formula:
spareH=(bllh-th-bh)%ch,
wherein spareH represents the margin size; splicing the zoomed head section picture, the zoomed middle section pictures of the target quantity and the zoomed tail section pictures along the target direction in sequence; stretching the zoomed head segment picture or the zoomed tail segment picture along the target direction to obtain the spark H, or stretching the zoomed head segment picture and the zoomed tail segment picture along the target direction to obtain the spliced target background picture.
In the implementation mode, the provided residue formula can be used for simply and reliably calculating the residue size required to be compensated by the splicing target background picture, and then the residue size is allocated to the zoomed head segment picture and/or the zoomed tail segment picture (the residue size is compensated by stretching the zoomed head segment picture and/or the zoomed tail segment picture), so that the continuity and repeatability of the pattern spliced by the middle segment picture are not influenced, and the residue size is allocated to the head segment picture and the tail segment picture (particularly the tail segment picture) due to the special positions of the head segment picture and the tail segment picture, and a user can hardly perceive the residue size, so that the user experience is hardly influenced.
With reference to the first aspect, in a fifth possible implementation manner of the first aspect, determining a target number of middle section pictures to be spliced based on a size of a target background picture in the target direction, and sizes of a zoomed head section picture, a zoomed middle section picture, and a zoomed tail section picture in the target direction includes:
calculating the undetermined number of the middle section pictures needing splicing by using the following rounding formula:
centerImageCount’=(bllh-th-bh)/ch,
wherein the centerImageCount' represents the undetermined number, bllh represents the size of the target background picture in the target direction, th represents the size of the zoomed head segment picture in the target direction, ch represents the size of the zoomed middle segment picture in the target direction, and bh represents the size of the zoomed tail segment picture in the target direction;
calculating the residual size to be compensated by splicing the zoomed head segment picture and the zoomed tail segment picture and the zoomed middle segment picture of undetermined quantity with the zoomed middle segment picture by using the following complementary formula:
spareH=(bllh-th-bh)%ch,
wherein spareH represents the margin size;
reacting spark H with
Figure BDA0003413040180000061
Comparing;
if it is
Figure BDA0003413040180000062
Adding one to the undetermined quantity of the centrImageCount' to obtain a target quantity of the centrImageCount, and determining a compensation size complementahCH-spark;
if it is
Figure BDA0003413040180000063
The pending number centermagecount' is determined as the target number centermagecount.
In the implementation mode, the allowance size is compared with a half of the size of the zoomed middle-section picture in the target direction, so that the allowance size is determined to be filled in a stretching mode, or the compensation size is erased in a compressing mode, and the mode with the minimum adjustment amount can be selected for implementation, so that the stretching deformation degree or the compression deformation degree of the pattern in the target background picture is reduced as far as possible, a user is enabled to be more difficult to perceive the deformation, and the user experience is guaranteed.
With reference to the fifth possible implementation manner of the first aspect, in a sixth possible implementation manner of the first aspect, splicing the target background picture based on the zoomed head segment picture, the zoomed tail segment picture, and the target number of zoomed middle segment pictures includes: to is directed at
Figure BDA0003413040180000064
The case (2) is as follows: splicing the zoomed head section picture, the zoomed middle section pictures of the target quantity and the zoomed tail section pictures along the target direction in sequence; compressing the zoomed head segment picture or the zoomed tail segment picture into complementateH along the target direction, or compressing the zoomed head segment picture and the zoomed tail segment picture into complementateH integrally along the target direction to obtain the spliced target background picture; to is directed at
Figure BDA0003413040180000071
The case (2) is as follows: sequentially zooming the head segment picture, the target number of zoomed middle segment pictures and the zoomed middle segment pictureSplicing tail section pictures along the target direction; stretching the zoomed head segment picture or the zoomed tail segment picture along the target direction to obtain the spark H, or stretching the zoomed head segment picture and the zoomed tail segment picture along the target direction to obtain the spliced target background picture.
In this implementation, for different cases (
Figure BDA0003413040180000072
Or
Figure BDA0003413040180000073
) And a corresponding picture splicing mode is adopted, so that the harmony of the target background pictures obtained by splicing can be ensured as much as possible, and the user experience is ensured.
In a second aspect, an embodiment of the present application provides a background picture generating device suitable for different aspect ratios, including: the device comprises an acquisition unit, a processing unit and a display unit, wherein the acquisition unit is used for acquiring a head section picture, a middle section picture and a tail section picture which are obtained based on the division of a basic background picture, a pattern repetition region exists in the middle section of the basic background picture along a target direction, the target direction is any one direction of the width direction and the height direction of the basic background picture, the middle section picture is part or all of the pattern repetition region, and the continuity of patterns in a spliced picture is not damaged when two identical middle section pictures are sequentially spliced along the target direction; a scaling unit, configured to scale a head segment picture, a middle segment picture, and a tail segment picture to have a size in a reference direction that is the other one of the width direction and the height direction except the target direction and a size in the reference direction of a target background picture, respectively; the calculation unit is used for determining the target number of the middle section pictures needing to be spliced based on the size of the target background picture in the target direction and the sizes of the zoomed head section picture, the zoomed middle section picture and the zoomed tail section picture in the target direction; and the splicing unit is used for splicing the target background picture based on the zoomed head segment picture, the zoomed tail segment picture and the zoomed middle segment pictures of the target quantity.
In a third aspect, an embodiment of the present application provides a storage medium, where the storage medium includes a stored program, and when the program runs, a device in which the storage medium is located is controlled to execute the method for generating a background picture applicable to different aspect ratios according to the first aspect or any one of possible implementation manners of the first aspect.
In a fourth aspect, an embodiment of the present application provides a terminal device, including a memory and a processor, where the memory is configured to store information including program instructions, and the processor is configured to control execution of the program instructions, where the program instructions are loaded and executed by the processor to implement the background picture generation method applicable to different aspect ratios described in the first aspect or any of possible implementation manners of the first aspect.
In order to make the aforementioned objects, features and advantages of the present application more comprehensible, preferred embodiments accompanied with figures are described in detail below.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are required to be used in the embodiments of the present application will be briefly described below, it should be understood that the following drawings only illustrate some embodiments of the present application and therefore should not be considered as limiting the scope, and that those skilled in the art can also obtain other relevant drawings from these drawings without inventive effort.
Fig. 1 is a flowchart of a background picture generation method applicable to different aspect ratios according to an embodiment of the present application.
Fig. 2 is a schematic diagram of a basic background picture provided in the embodiment of the present application.
Fig. 3 is a schematic diagram of a basic background picture divided into a head picture, a middle picture and a tail picture.
Fig. 4 is a schematic diagram of a process of stitching a target background picture based on the first mode.
Fig. 5 is a schematic diagram of a process of stitching a target background picture based on the second mode.
Fig. 6 is a block diagram of a background picture generation apparatus suitable for different aspect ratios according to an embodiment of the present application.
Fig. 7 is a block diagram of a terminal device according to an embodiment of the present application.
Icon: 10-background picture generating device suitable for different aspect ratios; 11-an acquisition unit; 12-a scaling unit; 13-a calculation unit; 14-a splicing unit; 20-a terminal device; 21-a memory; 22-a communication module; 23-a bus; 24-a processor.
Detailed Description
The technical solutions in the embodiments of the present application will be described below with reference to the drawings in the embodiments of the present application.
In this embodiment, the background picture generation method suitable for different aspect ratios can be applied to a terminal device, and target background pictures with different aspect ratios are adapted to scenes with different aspect ratios.
Referring to fig. 1, fig. 1 is a flowchart illustrating a background picture generation method suitable for different aspect ratios according to an embodiment of the present disclosure. In the present embodiment, the background picture generation method applicable to different aspect ratios may include step S10, step S20, step S30, and step S40.
When a background picture needs to be added to a service scene, for convenience of description, in this embodiment, the height and width applicable to the background picture are used as the target aspect ratio, and then, the present solution needs to provide a target background picture satisfying the height and width (target aspect ratio) of the target background picture.
Based on this, the terminal device may perform step S10.
Step S10: the method comprises the steps of obtaining a head section picture, a middle section picture and a tail section picture which are obtained based on division of a basic background picture, wherein a pattern repetition region exists in the middle section of the basic background picture along a target direction, the target direction is any direction of the width direction and the height direction of the basic background picture, the middle section picture is part or all of the pattern repetition region, and when two identical middle section pictures are sequentially spliced along the target direction, continuity of patterns in a spliced picture is not damaged.
In the embodiment of the application, the terminal device may obtain a head segment picture, a middle segment picture and a tail segment picture obtained based on the division of the basic background picture. The middle section of the basic background picture has a pattern repetition region along a target direction (any direction of the width direction and the height direction of the basic background picture), the middle section picture is a part or all of the pattern repetition region (usually, a part is taken, but the situation that the whole pattern repetition region is taken is not excluded), and the continuity of the pattern in the spliced picture is not damaged when two identical middle section pictures are spliced in sequence along the target direction.
For example, the terminal device may obtain a base background picture that needs to be adapted to a target aspect ratio, where the aspect ratio of the base background picture is different from or the same as the target aspect ratio, that is, the two are independent of each other, and there is no need to have an association relationship between the size and the aspect ratio.
As shown in fig. 2, the middle section (i.e., the head and tail portions in the non-target direction) in the base background picture has a pattern repetition region along the target direction (the height direction of the base background picture is shown in fig. 2 as the target direction, which is taken as an example and not a limitation), and the pattern in the pattern repetition region is periodically repeated along the target direction.
Based on this, the terminal device may determine a pattern repetition region in the basic background picture, and then divide the basic background picture into a header picture located on one side (a head side, i.e., an upper side) of the pattern repetition region, a footer picture located on the other side (a footer side, i.e., a lower side) of the pattern repetition region, and an undetermined picture where the pattern repetition region is located, with the pattern repetition region as a boundary. Then, a middle section picture can be further determined based on the pending picture.
The method comprises the steps of determining a pattern repetition region (patterns in the region are periodically repeated along a target direction) from a basic background picture (the aspect ratio of the basic background picture is different from or the same as the target aspect ratio) which needs to be suitable for a target aspect ratio (namely the aspect ratio of the target background picture), dividing the basic background picture into a head section picture at one side of the pattern repetition region, a tail section picture at the other side of the pattern repetition region and an undetermined picture where the pattern repetition region is located by taking the pattern repetition region as a boundary, and further determining a middle section picture based on the undetermined picture. In this way, the basic background picture can be divided into a head picture and a tail picture which are not required to be repeatedly spliced and are arranged on two sides, and a middle picture which is required to be repeatedly spliced (determined based on the undetermined picture), so that the spliced target background picture and the provided basic background picture can be ensured to have larger commonality (the head and the tail are respectively the same, and the middle picture has middle pictures with different repetition times according to different aspect ratios), the feeling of a user is not obtrusive, and the user experience can be ensured.
Specifically, the terminal device may further determine a minimum repeating unit from the pattern repeating region of the to-be-determined picture, where a minimum repeating unit indicates that the pattern repeating region extends along the target direction and repeats based on the minimum repeating unit. Then, the terminal device may divide a picture including one minimum repetition unit or a plurality of consecutive minimum repetition units from the pending pictures as a middle-segment picture.
For example, for a case where the size of one minimum repetition unit is particularly small, for example, the size of the minimum repetition unit is only the larger size of the head and tail pictures
Figure BDA0003413040180000111
The following components,
Figure BDA0003413040180000112
Hereinafter, etc., pictures of consecutive minimum repeating units may be determined as middle pictures (e.g., 4, 5, 8, 10, etc.). For the case that the size of a minimum repeating unit is not particularly small, for example, the size of the minimum repeating unit is only the larger size of the head and tail pictures
Figure BDA0003413040180000113
The above,
Figure BDA0003413040180000114
And if so, dividing a picture containing a minimum repeating unit from the pending pictures as a middle picture.
When a minimum repeating unit is divided to be used as a middle-section picture, the middle-section picture can be adapted to a wider background picture as far as possible; and the pictures of a plurality of continuous minimum repeating units are used as the middle section pictures, so that the workload of splicing the pictures can be increased by selecting the middle section pictures with smaller sizes when the sizes of the head section pictures and the tail section pictures in the target direction are far larger than those of the middle section pictures, and the efficiency of splicing the pictures is effectively improved by using the pictures of the plurality of continuous minimum repeating units as the middle section pictures.
It should be noted that, in this embodiment, a specific manner of dividing the basic background picture to obtain the head picture, the middle picture, and the end picture may be determined by a user performing certain auxiliary operations, for example, determining positions of dividing each picture (the head picture, the middle picture, the end picture, the to-be-determined picture, and the like), so as to divide and obtain the head picture, the middle picture, and the end picture. Of course, the image may also be obtained by intelligently dividing the terminal device in an image recognition and image segmentation manner, for example, by performing contour detection on the basic background picture, detecting a start point and an end point of the pattern repetition region in the target direction, and thereby dividing the basic background picture into a head picture, an undetermined picture and a tail picture; then, the starting point and the end point of each repeated pattern are further determined in a contour matching mode, so that a middle section picture is divided from the picture to be determined. Therefore, the specific manner adopted when the basic background picture is divided into the head segment picture, the middle segment picture and the tail segment picture should not be considered as a limitation to the present application. Based on the basic background picture, a head picture, a middle picture and a tail picture are obtained, as shown in fig. 3.
After acquiring the head segment picture, the middle segment picture, and the tail segment picture obtained based on the division of the base background picture, the terminal device may execute step S20.
Step S20: scaling a head segment picture, a middle segment picture and a tail segment picture respectively in an equal ratio until the size of the head segment picture, the middle segment picture and the tail segment picture in a reference direction is consistent with the size of a target background picture in the reference direction, wherein the reference direction is the other direction except the target direction in the width direction and the height direction.
In this embodiment, the terminal device may scale the head segment picture, the middle segment picture, and the tail segment picture to have a size in a reference direction that is the other one of the width direction and the height direction except the target direction, which is the same as the size of the target background picture in the reference direction, respectively. Referring to fig. 2 again, the height direction of the base background picture is taken as the target direction, and then the width direction of the base background picture is the reference direction (the same is true for the target background picture).
After scaling the head picture, the middle picture, and the tail picture to have the size in the reference direction consistent with the size of the target background picture in the reference direction, the terminal device may perform step S30.
Step S30: and determining the target number of the middle section pictures needing to be spliced based on the size of the target background picture in the target direction and the sizes of the zoomed head section picture, the zoomed middle section picture and the zoomed tail section picture in the target direction.
In this embodiment, the terminal device may determine the target number of the middle section pictures to be spliced based on the size of the target background picture in the target direction, and the sizes of the zoomed head section picture, the zoomed middle section picture and the zoomed tail section picture in the target direction.
Two ways of determining the target number are described in this embodiment by way of example.
Firstly, in a first mode, the terminal device may calculate the target number of the middle section pictures to be spliced by using the following rounding formula:
centerImageCount=(bllh-th-bh)/ch, (1)
wherein, the centerImageCount represents the target number, bllh represents the size of the target background picture in the target direction, th represents the size of the zoomed head segment picture in the target direction, ch represents the size of the zoomed middle segment picture in the target direction, and bh represents the size of the zoomed tail segment picture in the target direction.
And calculating the target number of the middle section pictures to be spliced by using the rounding formula provided by the first mode, and simply and reliably determining the target number of the middle section pictures to be spliced.
Secondly, in a second mode, the terminal device can calculate the undetermined number of the middle section pictures to be spliced by using the following rounding formula:
centerImageCount’=(bllh-th-bh)/ch, (2)
wherein, the centerImageCount' represents the undetermined number, bllh represents the size of the target background picture in the target direction, th represents the size of the zoomed head picture in the target direction, ch represents the size of the zoomed middle picture in the target direction, and bh represents the size of the zoomed tail picture in the target direction.
Then, the terminal device can calculate the residual size to be compensated by the zoomed head segment picture, the zoomed tail segment picture and the zoomed middle segment picture splicing target background pictures according to the following complementary formula:
spareH=(bllh-th-bh)%ch, (3)
wherein spareH represents the margin size.
The terminal device may then associate spark H with
Figure BDA0003413040180000131
And (3) comparison:
if it is
Figure BDA0003413040180000132
The terminal device may add one to the pending number centterimagecount' to obtain the target number centterimagecount, that is:
centerImageCount=centerImageCount’+1, (4)
the compensated dimension complementath is further determined:
compensateH=ch-spareH。 (5)
if it is
Figure BDA0003413040180000141
The terminal device may determine the pending number centterimagecount' as the target number centterimagecount, that is:
centerImageCount=centerImageCount’, (6)
in this case, the compensation dimension complementath need not be determined, but the margin dimension spareH is used.
The residual size is compared with half of the size of the zoomed middle-section picture in the target direction, so that the residual size is filled in by adopting a stretching mode, the compensation size is erased by adopting a compressing mode, and the mode with the minimum adjustment quantity can be selected to be carried out, so that the stretching deformation degree or the compression deformation degree of the pattern in the target background picture is reduced as far as possible, a user is enabled to be more difficult to perceive the deformation, and the user experience is ensured.
After determining the target number of the middle section pictures to be spliced, the terminal device may execute step S40.
Step S40: and splicing the target background picture based on the zoomed head segment picture, the zoomed tail segment picture and the zoomed middle segment pictures of the target quantity.
In this embodiment, the terminal device may splice a target background picture meeting the target aspect ratio based on the zoomed head segment picture and the zoomed tail segment picture, and the zoomed middle segment pictures of the target number.
For example, when the number of the targets is determined in different manners, the manner of splicing the target background pictures is different, so the manner of splicing the target background pictures is introduced in the present scheme from two cases.
For the target number of the middle section pictures to be spliced determined in the first mode, the terminal device may calculate the residual size to be compensated by the zoomed head section pictures and the zoomed tail section pictures and the target background pictures spliced by the zoomed middle section pictures of the target number by using the provided following formula:
spareH=(bllh-th-bh)%ch, (7)
wherein spareH denotes the residual size.
And then, the terminal equipment can splice the zoomed head section picture, the zoomed middle section pictures of the target quantity and the zoomed tail section pictures along the target direction in sequence. Then, the zoomed head segment picture or the zoomed tail segment picture can be stretched spark h along the target direction to obtain the spliced target background picture. Or integrally stretching the zoomed head segment picture and the zoomed tail segment picture along the target direction to obtain the spliced target background picture. Or, the zoomed head segment picture, the zoomed middle segment pictures of the spliced target number and the zoomed tail segment picture are integrally stretched in the target direction to obtain the spliced target background picture. The process of stitching the target background pictures in this way is shown in fig. 4.
The allowance size required to be compensated for splicing the target background pictures can be simply and reliably calculated by utilizing the provided allowance formula, then the allowance size is distributed to the zoomed head section picture and/or the zoomed tail section picture (the allowance size is compensated by stretching the zoomed head section picture and/or the zoomed tail section picture), the continuity and the repeatability of the pattern spliced by the middle section picture are not influenced, in addition, the allowance size is distributed to the head section picture and the tail section picture (particularly the tail section picture) due to the special positions of the head section picture and the tail section picture, and a user can hardly perceive the allowance size, so the user experience is hardly influenced. In addition, the zoomed head segment picture, the zoomed middle segment pictures of the spliced target number and the zoomed tail segment picture are integrally stretched along the target direction, so that the allowance size can be distributed to each sub-picture (the head segment picture, each middle segment picture, the tail segment picture and the like), and the stretching deformation can be reduced as much as possible.
It should be noted that, when performing image splicing, the margin size may be first allocated to the zoomed head segment image and/or the zoomed tail segment image, and then the images are spliced, which is based on what manner is actually adopted and is more convenient, and this is not limited here. Of course, for the way of allocating the margin size to each sub-picture, the splicing and then the stretching are required, and the specific size for allocating the margin size to each sub-picture does not need to be calculated.
For the target number of the middle section pictures to be spliced determined in the second mode, the terminal device can respectively adopt different modes based on two different conditions:
first, to
Figure BDA0003413040180000161
The case (2) is as follows:
the terminal device may sequentially splice the zoomed head segment picture, the zoomed middle segment pictures of the target number, and the zoomed tail segment pictures along the target direction, and then compress the zoomed head segment picture or tail segment picture along the target direction to obtain the spliced target background picture. Or, compressing the zoomed head segment picture and the zoomed tail segment picture integrally along the target direction to obtain the spliced target background picture. Or, the zoomed head segment picture, the zoomed middle segment picture of the spliced target number and the zoomed tail segment picture are compressed into complementateh along the target direction to obtain the spliced target background picture. The process of stitching the target background pictures in this way is shown in fig. 5.
Secondly, aim at
Figure BDA0003413040180000162
The case (2) is as follows:
the terminal device may sequentially splice the zoomed head segment picture, the zoomed middle segment pictures of the target number, and the zoomed tail segment pictures along the target direction, and then stretch the zoomed head segment picture or the zoomed tail segment picture along the target direction to obtain a spliced target background picture. Or integrally stretching the zoomed head segment picture and the zoomed tail segment picture along the target direction to obtain the spliced target background picture. Or, the zoomed head segment picture, the zoomed middle segment pictures of the spliced target number and the zoomed tail segment picture are integrally stretched in the target direction to obtain the spliced target background picture. The process of stitching the target background pictures in this way is shown in fig. 4.
For different cases (
Figure BDA0003413040180000163
Or
Figure BDA0003413040180000164
) And a corresponding picture splicing mode is adopted, so that the harmony of the target background pictures obtained by splicing can be ensured as much as possible, and the user experience is ensured.
For ease of understanding, the present embodiment provides a practical example to explain the application of the background picture generation method to different aspect ratios.
First, a basic background picture may be obtained, where the basic background picture may be a background picture selected by a developer, or a basic background picture obtained from a background picture library (where a pattern repetition region exists in a middle section of the basic background picture along a target direction), and this is not limited herein.
Then, the basic background picture can be segmented according to requirements to obtain three pictures: the image splicing method comprises a head section image, a middle section image and a tail section image, wherein the middle section image is part or all of a pattern repetition region, and when two identical middle section images are sequentially spliced along a target direction, the continuity of patterns in the spliced images is not damaged.
And then, the native Android-like LinearLayout can be inherited, so that a background picture can be drawn according to the width and height of the background picture, and the width and height (target width-to-height ratio) of the target background picture can be determined.
Further, the widths of the head segment picture, the middle segment picture and the tail segment picture can be scaled to the width of background linear layout in an equal ratio to obtain the height th of the top graph, the height bh of the bottom graph and the height ch of the middle graph after scaling. And calculating the number of required middle section pictures according to th, bh, ch and bllh, wherein the centrimagecount is (bllh-th-bh)/ch. In the case where the centremiagecount is a decimal number (i.e., cannot be divided), sparh is (blh-th-bh)% ch, and sparh is the remainder obtained (i.e., the residual size).
From top to bottom, drawing a head picture, then drawing a middle picture according to th, ch and centremiagecount in a circulating manner, and finally drawing a tail picture, if the spark H is not 0, firstly zooming the height of the base picture to be bh + spark H, and then drawing, so that the base picture is slightly stretched, and the spark H can be distributed to the heights of other pictures or the heights of all the pictures. Therefore, splicing and drawing of the target background picture can be realized.
In addition, in the background picture generation method applied to different aspect ratios in this embodiment, the basic background picture is described as follows: a pattern repetition region exists in the middle section of the basic background picture along the target direction (that is, all patterns in the region are repeated, no color requirement is made, whether color is limited or not can be determined according to actual conditions, and only the spliced target basic picture is integrally coordinated and the transition of the joint is natural), but the method is not limited thereto. In practical applications, some irregular fine structures may also exist, and are not required to be strictly repeated, for example, irregular sawtooth edges (the interval of each sawtooth does not exceed 2mm) may also be processed as the basic background picture of the background picture generation method applicable to different aspect ratios provided by this embodiment, so as to splice the target background picture.
Referring to fig. 6, fig. 6 is a block diagram of a background picture generation apparatus 10 suitable for different aspect ratios according to an embodiment of the present disclosure. In this embodiment, the background picture generation apparatus 10 to which different aspect ratios are applied may include:
the acquiring unit 11 is configured to acquire a head segment picture, a middle segment picture, and a tail segment picture obtained based on division of a basic background picture, where a pattern repetition region exists in the middle segment of the basic background picture along a target direction, the target direction is any one of a width direction and a height direction of the basic background picture, the middle segment picture is part or all of the pattern repetition region, and when two identical middle segment pictures are sequentially spliced along the target direction, continuity of patterns in the spliced picture is not damaged.
A scaling unit 12, configured to scale the head segment picture, the middle segment picture, and the tail segment picture to have a size in a reference direction consistent with a size of the target background picture in the reference direction, respectively, where the reference direction is another direction of the width direction and the height direction except the target direction.
And the calculating unit 13 is configured to determine the target number of the middle section pictures to be spliced based on the size of the target background picture in the target direction, and the sizes of the zoomed head section picture, the zoomed middle section picture and the zoomed tail section picture in the target direction.
And a splicing unit 14, configured to splice the target background picture based on the zoomed head segment picture and the zoomed tail segment picture, and the zoomed middle segment pictures of the target number.
In this embodiment, the obtaining unit 11 is specifically configured to: acquiring a basic background picture which needs to be suitable for a target aspect ratio, wherein the aspect ratio of the basic background picture is different from or the same as the target aspect ratio; determining a pattern repetition region in the basic background picture, wherein patterns in the pattern repetition region are periodically repeated along the target direction; dividing the basic background picture into a head picture positioned at one side of the pattern repeating region, a tail picture positioned at the other side of the pattern repeating region and an undetermined picture in which the pattern repeating region is positioned by taking the pattern repeating region as a boundary; and determining the middle section picture based on the undetermined picture.
In this embodiment, the obtaining unit 11 is specifically configured to: determining a minimum repeating unit from the pattern repeating area of the picture to be determined, wherein the minimum repeating unit represents that the pattern repeating area extends along the target direction and is repeated by taking the minimum repeating unit as a reference; and dividing a picture containing one minimum repeating unit or a plurality of continuous minimum repeating units from the pending pictures as the middle picture.
In this embodiment, the calculating unit 13 is specifically configured to: calculating the target number of the middle section pictures needing to be spliced by using the following rounding formula:
centerImageCount=(bllh-th-bh)/ch,
wherein the centerImageCount represents a target number, bllh represents a size of the target background picture in the target direction, th represents a size of the zoomed head segment picture in the target direction, ch represents a size of the zoomed middle segment picture in the target direction, and bh represents a size of the zoomed tail segment picture in the target direction.
In this embodiment, the splicing unit 14 is configured to calculate a margin size to be compensated for splicing the target background picture with the zoomed head segment picture and the zoomed tail segment picture, and the target number of zoomed middle segment pictures by using the following formula:
spareH=(bllh-th-bh)%ch,
wherein spareH represents the margin size;
splicing the zoomed head section picture, the zoomed middle section pictures of the target quantity and the zoomed tail section pictures along the target direction in sequence;
stretching the zoomed head segment picture or the zoomed tail segment picture along the target direction to obtain the spark H, or stretching the zoomed head segment picture and the zoomed tail segment picture along the target direction to obtain the spliced target background picture.
In this embodiment, the calculating unit 13 is further configured to: calculating the undetermined number of the middle section pictures needing splicing by using the following rounding formula:
centerImageCount’=(bllh-th-bh)/ch,
wherein the centerImageCount' represents the undetermined number, bllh represents the size of the target background picture in the target direction, th represents the size of the zoomed head segment picture in the target direction, ch represents the size of the zoomed middle segment picture in the target direction, and bh represents the size of the zoomed tail segment picture in the target direction; calculating the residual size to be compensated by splicing the zoomed head segment picture and the zoomed tail segment picture and the zoomed middle segment picture of undetermined quantity with the zoomed middle segment picture by using the following complementary formula:
spareH=(bllh-th-bh)%ch,
wherein spareH represents the margin size; reacting spark H with
Figure BDA0003413040180000201
Comparing; if it is
Figure BDA0003413040180000202
Adding one to the undetermined quantity of the centrImageCount' to obtain a target quantity of the centrImageCount, and determining a compensation size complementahCH-spark; if it is
Figure BDA0003413040180000203
The pending number centermagecount' is determined as the target number centermagecount.
In this embodiment, the splicing unit 14 is configured to:
to is directed at
Figure BDA0003413040180000204
The case (2) is as follows: splicing the zoomed head section picture, the zoomed middle section pictures of the target quantity and the zoomed tail section pictures along the target direction in sequence; compressing the zoomed head segment picture or the zoomed tail segment picture into complementateH along the target direction, or compressing the zoomed head segment picture and the zoomed tail segment picture into complementateH integrally along the target direction to obtain the spliced target background picture;
to is directed at
Figure BDA0003413040180000205
The case (2) is as follows: sequentially zooming the head section picture, the target number of zoomed middle section pictures and the zoomed tail section pictureSplicing the target directions; stretching the zoomed head segment picture or the zoomed tail segment picture along the target direction to obtain the spark H, or stretching the zoomed head segment picture and the zoomed tail segment picture along the target direction to obtain the spliced target background picture.
Referring to fig. 7, fig. 7 is a block diagram of a terminal device 20 according to an embodiment of the present disclosure.
In this embodiment, the terminal device 20 may be a personal computer, a tablet computer, a smart phone, and the like, which are only terminals, and is not limited herein.
Illustratively, the terminal device 20 may include: a communication module 22 connected to the outside world via a network, one or more processors 24 for executing program instructions, a bus 23, and a different form of memory 21, such as a disk, ROM, or RAM, or any combination thereof. And, the terminal device 20 further has a display screen that can display the generated target background picture. The memory 21, the communication module 22, and the processor 24 may be connected by a bus 23.
Illustratively, the memory 21 has stored therein a program. The processor 24 may call and execute these programs from the memory 21, so that the background picture generation method suitable for different aspect ratios can be implemented by executing the programs.
The embodiment of the present application further provides a storage medium, where the storage medium includes a stored program, and when the program runs, the device on which the storage medium is located is controlled to execute the background picture generation method applicable to different aspect ratios in this embodiment.
To sum up, the embodiments of the present application provide a method, an apparatus, a medium, and a device for generating background pictures suitable for different aspect ratios, where a middle section of a basic background picture has a pattern repeat region along a target direction, a head section picture, a middle section picture (a part or all of the pattern repeat region), and a tail section picture obtained by dividing the basic background picture are obtained as a basis for splicing the target background picture (the head section picture, the middle section picture, and the tail section picture need to be scaled to have a size in a reference direction consistent with a size of the target background picture in the reference direction), and when two identical middle section pictures are sequentially spliced along the target direction, continuity of patterns in the spliced picture is not broken, so that background pictures suitable for different aspect ratios (target background pictures with different sizes can be spliced in the target direction) can be spliced by splicing the middle section pictures of different numbers, and because the continuity of the patterns in the spliced picture cannot be damaged, the feeling of the background picture to the user is very smooth and unobtrusive, and the user experience can be ensured. The target number of the middle section pictures to be spliced can be determined by the size of the target background picture in the target direction and the sizes of the zoomed head section picture, the zoomed middle section picture and the zoomed tail section picture in the target direction, thereby splicing the target background picture by utilizing the zoomed head segment picture, the zoomed tail segment picture and the zoomed middle segment pictures of the target quantity, thus, the appropriate number of middle pictures can be reasonably used as much as possible, the size difference required to be compensated when splicing the target background pictures is reduced (for example, each picture can be stretched or compressed), therefore, the stretching deformation can be controlled within a small range (even to the extent of no stretching or compression deformation), and the user can hardly perceive the stretching deformation, so that the method can be well applied to service scenes with different aspect ratio background picture requirements.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other ways. The above-described embodiments are merely illustrative, and for example, the division of the units is only one logical functional division, and there may be other divisions in actual implementation, and 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 this document, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions.
The above description is only an example of the present application and is not intended to limit the scope of the present application, and various modifications and changes may be made by those skilled in the art. Any modification, equivalent replacement, improvement and the like made within the spirit and principle of the present application shall be included in the protection scope of the present application.

Claims (10)

1. A method for generating background pictures suitable for different aspect ratios is characterized by comprising the following steps:
acquiring a head section picture, a middle section picture and a tail section picture which are obtained based on the division of a basic background picture, wherein the middle section of the basic background picture has a pattern repetition region along a target direction, the target direction is any one direction of the width direction and the height direction of the basic background picture, the middle section picture is part or all of the pattern repetition region, and the continuity of patterns in a spliced picture is not damaged when two identical middle section pictures are sequentially spliced along the target direction;
respectively scaling a head segment picture, a middle segment picture and a tail segment picture in an equal ratio mode until the size of the head segment picture, the middle segment picture and the tail segment picture in a reference direction is consistent with the size of a target background picture in the reference direction, wherein the reference direction is the other direction except the target direction in the width direction and the height direction;
determining the target number of the middle section pictures needing to be spliced based on the size of the target background picture in the target direction and the sizes of the zoomed head section picture, the zoomed middle section picture and the zoomed tail section picture in the target direction;
and splicing the target background picture based on the zoomed head segment picture, the zoomed tail segment picture and the zoomed middle segment pictures of the target quantity.
2. The method according to claim 1, wherein obtaining the head segment picture, the middle segment picture and the tail segment picture obtained by dividing the base background picture comprises:
acquiring a basic background picture which needs to be suitable for a target aspect ratio, wherein the aspect ratio of the basic background picture is different from or the same as the target aspect ratio;
determining a pattern repetition region in the basic background picture, wherein patterns in the pattern repetition region are periodically repeated along the target direction;
dividing the basic background picture into a head picture positioned at one side of the pattern repeating region, a tail picture positioned at the other side of the pattern repeating region and an undetermined picture in which the pattern repeating region is positioned by taking the pattern repeating region as a boundary;
and determining the middle section picture based on the undetermined picture.
3. The method according to claim 2, wherein determining the middle section picture based on the pending picture comprises:
determining a minimum repeating unit from the pattern repeating area of the picture to be determined, wherein the minimum repeating unit represents that the pattern repeating area extends along the target direction and is repeated by taking the minimum repeating unit as a reference;
and dividing a picture containing one minimum repeating unit or a plurality of continuous minimum repeating units from the pending pictures as the middle picture.
4. The method according to claim 1, wherein the determining the target number of the middle section pictures to be spliced based on the size of the target background picture in the target direction and the sizes of the zoomed head section picture, the zoomed middle section picture and the zoomed tail section picture in the target direction comprises:
calculating the target number of the middle section pictures needing to be spliced by using the following rounding formula:
centerImageCount=(bllh-th-bh)/ch,
wherein the centerImageCount represents a target number, bllh represents a size of the target background picture in the target direction, th represents a size of the zoomed head segment picture in the target direction, ch represents a size of the zoomed middle segment picture in the target direction, and bh represents a size of the zoomed tail segment picture in the target direction.
5. The method according to claim 4, wherein the splicing out the target background picture based on the zoomed head segment picture and the zoomed tail segment picture and the zoomed middle segment pictures of the target number comprises:
calculating the residual size to be compensated by splicing the zoomed head segment picture and the zoomed tail segment picture and the zoomed middle segment pictures of the target number with the zoomed middle segment pictures by using the following complementary formula:
spareH=(bllh-th-bh)%ch,
wherein spareH represents the margin size;
splicing the zoomed head section picture, the zoomed middle section pictures of the target quantity and the zoomed tail section pictures along the target direction in sequence;
stretching the zoomed head segment picture or the zoomed tail segment picture along the target direction to obtain the spark H, or stretching the zoomed head segment picture and the zoomed tail segment picture along the target direction to obtain the spliced target background picture.
6. The method according to claim 1, wherein the determining the target number of the middle section pictures to be spliced based on the size of the target background picture in the target direction and the sizes of the zoomed head section picture, the zoomed middle section picture and the zoomed tail section picture in the target direction comprises:
calculating the undetermined number of the middle section pictures needing splicing by using the following rounding formula:
centerImageCount’=(bllh-th-bh)/ch,
wherein the centerImageCount' represents the undetermined number, bllh represents the size of the target background picture in the target direction, th represents the size of the zoomed head segment picture in the target direction, ch represents the size of the zoomed middle segment picture in the target direction, and bh represents the size of the zoomed tail segment picture in the target direction;
calculating the residual size to be compensated by splicing the zoomed head segment picture and the zoomed tail segment picture and the zoomed middle segment picture of undetermined quantity with the zoomed middle segment picture by using the following complementary formula:
spareH=(bllh-th-bh)%ch,
wherein spareH represents the margin size;
reacting spark H with
Figure FDA0003413040170000031
Comparing;
if it is
Figure FDA0003413040170000032
Adding one to the undetermined quantity of the centrImageCount' to obtain a target quantity of the centrImageCount, and determining a compensation size complementahCH-spark;
if it is
Figure FDA0003413040170000033
The pending number centermagecount' is determined as the target number centermagecount.
7. The method according to claim 6, wherein the splicing out the target background picture based on the zoomed head segment picture and the zoomed tail segment picture and the zoomed middle segment pictures of the target number comprises:
to is directed at
Figure FDA0003413040170000041
The case (2) is as follows:
splicing the zoomed head section picture, the zoomed middle section pictures of the target quantity and the zoomed tail section pictures along the target direction in sequence;
compressing the zoomed head segment picture or the zoomed tail segment picture into complementateH along the target direction, or compressing the zoomed head segment picture and the zoomed tail segment picture into complementateH integrally along the target direction to obtain the spliced target background picture;
to is directed at
Figure FDA0003413040170000042
The case (2) is as follows:
splicing the zoomed head section picture, the zoomed middle section pictures of the target quantity and the zoomed tail section pictures along the target direction in sequence;
stretching the zoomed head segment picture or the zoomed tail segment picture along the target direction to obtain the spark H, or stretching the zoomed head segment picture and the zoomed tail segment picture along the target direction to obtain the spliced target background picture.
8. A background picture generation apparatus adapted to different aspect ratios, comprising:
the device comprises an acquisition unit, a processing unit and a display unit, wherein the acquisition unit is used for acquiring a head section picture, a middle section picture and a tail section picture which are obtained based on the division of a basic background picture, a pattern repetition region exists in the middle section of the basic background picture along a target direction, the target direction is any one direction of the width direction and the height direction of the basic background picture, the middle section picture is part or all of the pattern repetition region, and the continuity of patterns in a spliced picture is not damaged when two identical middle section pictures are sequentially spliced along the target direction;
a scaling unit, configured to scale a head segment picture, a middle segment picture, and a tail segment picture to have a size in a reference direction that is the other one of the width direction and the height direction except the target direction and a size in the reference direction of a target background picture, respectively;
the calculation unit is used for determining the target number of the middle section pictures needing to be spliced based on the size of the target background picture in the target direction and the sizes of the zoomed head section picture, the zoomed middle section picture and the zoomed tail section picture in the target direction;
and the splicing unit is used for splicing the target background picture based on the zoomed head segment picture, the zoomed tail segment picture and the zoomed middle segment pictures of the target quantity.
9. A storage medium, comprising a stored program, wherein when the program runs, a device on which the storage medium is located is controlled to execute the background picture generation method according to any one of claims 1 to 7, wherein the method is applicable to different aspect ratios.
10. A terminal device comprising a memory for storing information including program instructions and a processor for controlling execution of the program instructions, the program instructions being loaded and executed by the processor to implement the background picture generation method applicable to different aspect ratios as claimed in any one of claims 1 to 7.
CN202111535784.4A 2021-12-15 2021-12-15 Background picture generation method, device, medium and equipment suitable for different aspect ratios Pending CN114281230A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111535784.4A CN114281230A (en) 2021-12-15 2021-12-15 Background picture generation method, device, medium and equipment suitable for different aspect ratios

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111535784.4A CN114281230A (en) 2021-12-15 2021-12-15 Background picture generation method, device, medium and equipment suitable for different aspect ratios

Publications (1)

Publication Number Publication Date
CN114281230A true CN114281230A (en) 2022-04-05

Family

ID=80872610

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111535784.4A Pending CN114281230A (en) 2021-12-15 2021-12-15 Background picture generation method, device, medium and equipment suitable for different aspect ratios

Country Status (1)

Country Link
CN (1) CN114281230A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117111803A (en) * 2023-10-20 2023-11-24 荣耀终端有限公司 Background image display method and electronic equipment

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117111803A (en) * 2023-10-20 2023-11-24 荣耀终端有限公司 Background image display method and electronic equipment
CN117111803B (en) * 2023-10-20 2024-04-05 荣耀终端有限公司 Background image display method and electronic equipment

Similar Documents

Publication Publication Date Title
US6285794B1 (en) Compression and editing of movies by multi-image morphing
CN110032314B (en) Long screen capture method and device, storage medium and terminal equipment
CN111161392B (en) Video generation method and device and computer system
KR20170025058A (en) Image processing apparatus and electronic system including the same
JP2009545813A (en) Establish and use dominant lines of images
WO2013179560A1 (en) Image processing device and image processing method
CN112055244B (en) Image acquisition method and device, server and electronic equipment
US20230362328A1 (en) Video frame insertion method and apparatus, and electronic device
CN114281230A (en) Background picture generation method, device, medium and equipment suitable for different aspect ratios
CN111290680B (en) List display method, device, terminal and storage medium
EP4075381A1 (en) Image processing method and system
CN112528596A (en) Rendering method and device for special effect of characters, electronic equipment and storage medium
CN107193815B (en) Page code processing method, device and equipment
CN115170695A (en) Method and device for generating chart picture, electronic equipment and storage medium
CN113379768A (en) Image processing method, image processing device, storage medium and computer equipment
CN111063001B (en) Picture synthesis method, device, electronic equipment and storage medium
CN113691835A (en) Video implantation method, device, equipment and computer readable storage medium
CN113096217A (en) Picture generation method and device, electronic equipment and storage medium
CN109684010B (en) Information display method and device and electronic equipment
CN112508831A (en) Ultrasonic wide-scene image generation method, device, equipment and storage medium
CN111198858A (en) File processing method and device, computer storage medium and terminal
CN113207037B (en) Template clipping method, device, terminal, system and medium for panoramic video animation
CN110929496B (en) Text template generation method and device
CN112734901A (en) 3D specification generation method and related equipment
CN115942058A (en) Video progress bar generation method, device, storage medium and device

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