Picture adaptation method and device, electronic equipment and storage medium

By visually identifying and layout adjustment of the interface resource map to be adapted by preset software applications, the problem of visual element deformation caused by manual image adjustment is solved, and the adaptation display and efficient adaptation of visual elements in different application scenarios is realized.

CN120448019APending Publication Date: 2025-08-08NETEASE (HANGZHOU) NETWORK CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510538862.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-25
Publication Date
2025-08-08

AI Technical Summary

Technical Problem

In the prior art, manual adjustment of picture size is likely to cause deformation or loss of visual elements, and it is impossible to maintain good visual effects in different application scenarios.

Method used

By visually identifying the interface resource map to be adapted by preset software applications, the target element label of the visual element is obtained, and layout adjustments are made based on the target adaptation information to generate the target interface resource map.

Benefits of technology

It realizes the adaptive display of visual elements in different application scenarios, avoids picture distortion and improves picture adaptation efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120448019A_ABST
    Figure CN120448019A_ABST
Patent Text Reader

Abstract

The invention provides a picture adaptation method and device, electronic equipment and a storage medium, and the method comprises the steps: carrying out the visual recognition of a to-be-adapted interface resource map of a preset software application, obtaining a target element tag of at least one visual element in the to-be-adapted interface resource map, and obtaining a target element tag of at least one visual element in the to-be-adapted interface resource map according to the target element tag of the at least one visual element; obtaining target adaptation information of the to-be-adapted interface resource map in a target application scene of the preset software application, and performing adaptation adjustment on the layout of the at least one visual element in the to-be-adapted interface resource map according to the target adaptation information, and obtaining a target interface resource map of the at least one visual element in a target application scene of the preset software application. Therefore, batch positioning of the at least one visual element is realized, so that the at least one visual element can be adaptively displayed for different application scenes, and picture distortion is avoided.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a method, device, electronic device, and storage medium for image adaptation. Background Art

[0002] After the artist creates the interface resource images, they usually need to adapt the images for different activities and channels to present good visual effects in different activities and channels.

[0003] In the related art, the size of the image is usually adjusted manually, but it can only be scaled proportionally or simply stretched. This is not only cumbersome to operate, but may also cause the visual elements in the image to be deformed or lost, making the image deformed and unusable. Summary of the Invention

[0004] In view of this, the embodiments of the present application provide an image adaptation method, device, electronic device and storage medium to solve the problem that manually adjusting the size of an image can only be done proportionally or simply stretched, which may cause the visual elements in the image to be deformed or lost, making the image deformed and unusable.

[0005] In a first aspect, an embodiment of the present application provides a method for image adaptation, comprising:

[0006] Performing visual recognition on a to-be-adapted interface resource graph of a preset software application to obtain a target element label of at least one visual element in the to-be-adapted interface resource graph;

[0007] According to the target element tag of the at least one visual element, obtaining target adaptation information of the to-be-adapted interface resource graph in the target application scenario of the preset software application;

[0008] According to the target adaptation information, the layout of the at least one visual element in the to-be-adapted interface resource map is adapted and adjusted to obtain a target interface resource map for the preset software application in the target application scenario.

[0009] In a second aspect, an embodiment of the present application further provides an image adaptation device, comprising:

[0010] An identification module, configured to perform visual identification on a to-be-adapted interface resource graph of a preset software application, and obtain a target element label of at least one visual element in the to-be-adapted interface resource graph;

[0011] An acquisition module, configured to acquire target adaptation information of the to-be-adapted interface resource graph in a target application scenario of the preset software application according to a target element tag of the at least one visual element;

[0012] A processing module is used to adapt and adjust the layout of the at least one visual element in the to-be-adapted interface resource map according to the target adaptation information, so as to obtain a target interface resource map for the preset software application in the target application scenario.

[0013] In a third aspect, an embodiment of the present application further provides an electronic device comprising: a processor, a memory and a bus, wherein the memory stores machine-readable instructions executable by the processor. When the electronic device is running, the processor communicates with the memory through the bus, and the processor executes the machine-readable instructions to execute any one of the methods described in the first aspect.

[0014] In a fourth aspect, an embodiment of the present application further provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the method described in any one of the first aspects is executed.

[0015] The present application provides an image adaptation method, apparatus, electronic device, and storage medium, wherein the method comprises: visually identifying an interface resource map to be adapted for a preset software application, obtaining a target element tag for at least one visual element in the interface resource map to be adapted, obtaining target adaptation information for the interface resource map to be adapted in a target application scenario of the preset software application based on the target element tag of the at least one visual element, and adapting and adjusting the layout of the at least one visual element in the interface resource map to be adapted based on the target adaptation information to obtain a target interface resource map for the at least one visual element in the target application scenario of the preset software application. This achieves batch positioning of at least one visual element, enabling the at least one visual element to be adapted and displayed for different application scenarios, thereby avoiding image distortion. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following is a brief introduction to the drawings required for use in the embodiments. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other relevant drawings can be obtained based on these drawings without creative work.

[0017] Figure 1 Schematic diagram of the process of the image adaptation method provided in the embodiment of the present application Figure 1 ;

[0018] Figure 2 Schematic diagram of the process of the image adaptation method provided in the embodiment of the present application Figure 2 ;

[0019] Figure 3A comparison diagram of the interface resource image to be adapted and the target interface resource image provided in the embodiment of the present application;

[0020] Figure 4 Schematic diagram of the process of the image adaptation method provided in the embodiment of the present application Figure 3 ;

[0021] Figure 5 Schematic diagram of the process of the image adaptation method provided in the embodiment of the present application Figure 4 ;

[0022] Figure 6 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application;

[0023] Figure 7 A schematic diagram of the structure of the image adaptation device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0024] In order to make the purpose, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. The components of the embodiments of the present application generally described and shown in the drawings here can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present application provided in the drawings is not intended to limit the scope of the application for protection, but merely represents the selected embodiments of the present application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without making creative work are within the scope of protection of this application.

[0025] After artists prepare interface resource images, they usually need to adapt the images for different activities and channels. For example, they need to manually adjust the image size by proportional scaling or simple stretching. This is not only cumbersome but may also cause the visual elements in the image to deform or be lost, making the image distorted and unusable.

[0026] Based on this, the present application obtains the target adaptation information of the preset application software in the target application scenario by labeling the target element of at least one visual element in the interface resource map to be adapted of the preset software application, so as to adapt and adjust the layout of at least one visual element in the interface resource map to be adapted, so that at least one visual element is adapted and displayed in the interface resource map to be adapted, thereby realizing batch positioning of at least one visual element.

[0027] Figure 1 Schematic diagram of the process of the image adaptation method provided in the embodiment of the present application Figure 1 The execution subject of this embodiment may be an electronic device.

[0028] like Figure 1 As shown, the method may include:

[0029] S101: Visually identify a to-be-adapted interface resource graph of a preset software application to obtain a target element label of at least one visual element in the to-be-adapted interface resource graph.

[0030] Among them, the resource map of the interface to be adapted can be a resource bitmap or an H5 cut-out. Among them, the resource bitmap refers to a bitmap format image resource used for specific display locations (such as advertising positions, activity entrances, function buttons, etc.) in web pages, mobile applications or advertising. H5 page cut-out refers to the process of cutting and exporting the visual elements in the H5 page design draft completed by the designer (usually PSD, Sketch or Figma files) into image resources that can be used on the web page according to development requirements. Different sizes of H5 page cut-outs need to be set for different activities and different channels.

[0031] The interface resource map to be adapted of a preset software application refers to the resource map produced by the art party for the preset software application for display on the interface, wherein the preset software application can be, for example, a game item trading software application. The interface resource map to be adapted includes at least one visual element, which is the content displayed on the interface, such as a title, character, function button, etc.

[0032] Visual identification is performed on the interface resource map to be adapted of the preset software application to obtain a target element label of at least one visual element in the interface resource map to be adapted, wherein the target element label is used to indicate the element type of the corresponding visual element, for example, it may include a logo (LOGO), character IP, and theme copy (title).

[0033] S102: Obtain target adaptation information of the to-be-adapted interface resource graph in a target application scenario of a preset software application according to a target element tag of at least one visual element.

[0034] Among them, the target application scenario is any application scenario under the preset software application. The application scenario of the preset software application is used to indicate the page type of the display page presented under the preset software application. For example, the preset software application is a game item trading software application. The application scenarios of the preset software application can include the item browsing page scenario, the item details page scenario, and the item trading page scenario.

[0035] In one possible implementation, based on the target element tag of at least one visual element, a pre-stored adaptation specification is queried to obtain target adaptation information of the interface resource diagram to be adapted in the target application scenario of the preset software application, wherein the adaptation specification may include: a correspondence between multiple element tags and the adaptation information corresponding to each element tag in different application scenarios of the preset software application, the adaptation information corresponding to each element tag may include the element position and element size of the visual element corresponding to each element tag in the interface resource diagram to be adapted, and the target adaptation information is the adaptation information for the interface resource diagram to be adapted in the target application scenario of the preset software application.

[0036] The element position refers to the position of the visual element in the resource map of the interface to be adapted, and the element size refers to the size of the visual element in the resource map of the interface to be adapted.

[0037] It is worth noting that the correspondence between the element tag and the adaptation information may be pre-established based on the adaptation of the visual element corresponding to the element tag in different application scenarios of the preset software application.

[0038] S103: Adapt and adjust the layout of the at least one visual element in the to-be-adapted interface resource map according to the target adaptation information to obtain a target interface resource map of the at least one visual element in a target application scenario of a preset software application.

[0039] According to the target adaptation information, the layout of at least one visual element in the interface resource map to be adapted is adjusted, that is, the position of each visual element in the interface resource map to be adapted is adjusted and the size of each visual element is adjusted to obtain a target interface resource map of at least one visual element in the target application scenario of the preset software application, wherein the target interface resource map is the interface resource map after the layout of at least one visual element in the interface resource map to be adapted is adjusted.

[0040] In this embodiment, compared with manually adjusting the image size for different activities and different channels to adapt the image, the position information of at least one visual element in the target application scenario of the preset software application is obtained based on the target element label of at least one visual element, so as to adjust the layout of at least one visual element to obtain the target resource interface diagram, thereby realizing batch positioning of at least one visual element, so that at least one visual element can be adapted and displayed for different application scenarios, avoiding image distortion, and improving the efficiency of image adaptation through the batch processing mechanism.

[0041] Figure 2 Schematic diagram of the process of the image adaptation method provided in the embodiment of the present application Figure 2 ,like Figure 2As shown, in an optional embodiment, the above step S103, based on the target adaptation information, adapts and adjusts the layout of at least one visual element in the to-be-adapted interface resource map to obtain a target interface resource map for the preset software application in the target application scenario, may include:

[0042] S201. Scale the interface resource map to be adapted according to the image size to obtain a scaled interface resource map.

[0043] S202 : Laying out corresponding visual elements in the scaled interface resource map according to element positions and element sizes to obtain a target interface resource map.

[0044] The target adaptation information includes: element position, element size, and image size. The element position refers to the position of the visual element, and the element size is used to indicate the size of the visual element.

[0045] The interface resource map to be adapted is scaled according to the image size to obtain a scaled interface resource map, and the size of the corresponding visual element in the scaled interface resource is adjusted to the element size and the position of the corresponding visual element in the scaled interface resource is adjusted to the element position according to the element position and element size, so as to lay out the corresponding visual elements in the scaled interface resource map, thereby obtaining a target interface resource map. The interface resource map to be adapted may be a resource bitmap.

[0046] It is worth noting that the image size can be represented by width and height, and the element position and element size can be represented by position coordinates, such as the coordinates of the upper left corner point (x1, y1) and the lower right corner point coordinates (x2, y2) of the visual element.

[0047] Figure 3 A comparison diagram of the interface resource image to be adapted and the target interface resource image provided in the embodiment of this application, such as Figure 3 As shown, the resource interface diagram to be adapted includes visual element 1 and visual element 2. The resource interface diagram to be adapted is reduced based on the image size, and the target element tags of visual element 1 and visual element 2 are obtained. The element position and element size of visual element 1, as well as the element position and element size of visual element 2, are determined according to the target element tags. Then, according to the element position and element size of visual element 1, as well as the element position and element size of visual element 2, visual element 1 and visual element 2 are respectively laid out in the reduced interface resource diagram to be adapted to generate a target interface resource diagram.

[0048] In this embodiment, by adjusting the size of the interface resource image to be adapted, as well as the position and size of the visual elements, a single image to be adapted can be adapted to different application scenarios of the preset software application, thus avoiding distortion of the image and visual elements.

[0049] In an optional embodiment, the above step S102, obtaining target adaptation information of the to-be-adapted interface resource graph in the target application scenario of the preset software application according to the target element tag of at least one visual element, may include:

[0050] According to the target element tag of at least one visual element and the device information of the target display device corresponding to the preset software application, target adaptation information of the to-be-adapted interface resource graph in the target application scenario is obtained.

[0051] The target display device corresponding to the preset software application is any display device that has the preset software application installed and is used to display the target interface resource map. The display device can be a mobile phone, tablet, laptop, or other electronic device with display capabilities. Device information may include device model, display configuration information, etc.

[0052] Based on the target element label of at least one visual element and the device information of the target display device, a pre-stored adaptation specification is queried to obtain the target adaptation information of the interface resource diagram to be adapted in the target application scenario of the preset software application, wherein the adaptation specification may include: for different display devices, the correspondence between the element label and the adaptation information in different application scenarios of the preset software application.

[0053] In this embodiment, target adaptation information is determined by considering device information, so that visual elements can adapt to different display devices to present better visual effects and avoid distortion of the display of visual elements due to incompatibility of display devices.

[0054] In some embodiments, according to a marking operation on the to-be-adapted interface resource graph, an application scenario corresponding to the marking operation is determined as a target application scenario, and a display device corresponding to the marking operation is determined as a target display device.

[0055] The marking operation on the to-be-adapted interface resource graph is used to mark the application scenario and display device for the to-be-adapted interface resource graph.

[0056] That is to say, by providing an interactive interface to mark the interface resource map to be adapted, the target application scenario and the target display device are determined, making the user operation more convenient and flexible.

[0057] Among them, the element position and element size of the visual element corresponding to the element label are represented by the element size area. The element size area can represent the upper left corner and the upper right corner of the area, for example, (0, 20), (1080, 360), the first coordinate represents the upper left corner point, and the second coordinate represents the lower right corner coordinate. The element size area can be used to quickly locate the position and size of the visual element.

[0058] In an optional embodiment, obtaining target adaptation information of the to-be-adapted interface resource graph in the target application scenario based on the target element tag of at least one visual element and device information of the target display device corresponding to the preset software application may include:

[0059] Determine target adaptation items from a preset adaptation specification based on scenario information of a target application scenario and device information of a target display device;

[0060] Target adaptation information is determined from target adaptation entries according to a target element tag of at least one visual element.

[0061] Among them, the preset adaptation specification includes multiple adaptation entries. The preset adaptation specification can be queried according to the scene information of the target application scenario and the device information of the target display device to determine the target adaptation entry, and then according to the target element label of at least one visual element, the target adaptation information of the interface resource diagram to be adapted in the target application scenario is determined from the target adaptation entry, wherein the target adaptation entry includes: for the target display device, the correspondence between the element label and the adaptation information in the target application scenario of the preset software application.

[0062] Table 1 is a schematic table of the adaptation specification. As shown in Table 1, for the preset software application, the display end includes device A, device B, and device C. The names include application scenario A, application scenario B, and application scenario C. Width and height respectively represent the height and width of the image. Element label 1: LOGO, element label 2: character IP, and element label 3: theme copy.

[0063] Table 1

[0064]

[0065] Taking device A and application scenario A as an example, element tag 1: the element size area of LOGO is expressed as (0, 20) and (1080, 360), which is used to represent the element position and element size of the visual element corresponding to element tag 1.

[0066] That is to say, by establishing an adaptation specification, the required generation results are set to be presented in a tabular form, which is used for the subsequent matching and identification of the resource diagram of the interface to be adapted and the adaptation specification. In the adaptation specification, a parameterized label system is established, and the element size area is pre-set, represented by the upper left corner point and the lower right corner point, where the element size area is the display area (accommodation area) of the visual element corresponding to the visual label.

[0067] For example, if the target display device is device A and the target application scenario is application scenario A, then the target adaptation entry is the adaptation entry corresponding to device A and application scenario A (i.e., the first row of adaptation entries). If the target element tag is element tag 1, then the determined target adaptation information is the element size area of (0, 20).

[0068] Figure 4 Schematic diagram of the process of the image adaptation method provided in the embodiment of the present application Figure 3 ,like Figure 4 As shown, in an optional embodiment, the above step S102, obtaining target adaptation information of the to-be-adapted interface resource graph in the target application scenario of the preset software application according to the target element tag of at least one visual element, may include:

[0069] S301: In response to an adaptation information acquisition operation for a resource image of an interface to be adapted, a preset adaptation information acquisition plug-in is called to acquire target adaptation information according to a target element tag of at least one visual element.

[0070] The adaptation information acquisition operation for the to-be-adapted interface resource graph may be a selection operation for the to-be-adapted interface resource graph.

[0071] In response to the adaptation information acquisition operation, a preset adaptation information acquisition plug-in is called to obtain target adaptation information based on the target element tag of at least one visual element, wherein the preset adaptation information acquisition plug-in is called to obtain target adaptation entries from the preset adaptation specification based on the scene information of the target application scenario and the device information of the target display device, and target adaptation information is obtained from the target adaptation entries based on the target element tag of at least one visual element.

[0072] In an optional embodiment, step S103, adapting and adjusting the layout of at least one visual element in the to-be-adapted interface resource map based on the target adaptation information to obtain a target interface resource map for the preset software application in the target application scenario, may include:

[0073] S302 : In response to an adaptation triggering operation on the to-be-adapted interface resource map, adapt and adjust the layout of at least one visual element in the to-be-adapted interface resource map according to target adaptation information to obtain a target interface resource map.

[0074] The adaptation triggering operation for the to-be-adapted interface resource graph may be a selection operation for an adaptation control in the interface.

[0075] That is to say, by selecting the adaptation control, the layout of at least one visual element in the interface resource map to be adapted is adapted and adjusted according to the target adaptation information to complete the adaptation from the image to be adapted to the target interface resource map, wherein the position of the visual element in the target interface resource map is placed according to the element size area corresponding to the element label.

[0076] In this embodiment, an interactive interface is provided to obtain target adaptation information and perform image adaptation, making user operations more convenient and flexible.

[0077] Figure 5 Schematic diagram of the process of the image adaptation method provided in the embodiment of the present application Figure 4 ,like Figure 5 As shown, in an optional embodiment, the above step S101, performing visual recognition on the to-be-adapted interface resource graph of the preset software application to obtain a target element label of at least one visual element in the to-be-adapted interface resource graph, may include:

[0078] S401: Perform background cutting on the target interface design drawing to obtain multiple background cut images.

[0079] Among them, the target interface design drawing can be an H5 page design draft. The visual elements in the target interface design drawing are deleted to obtain the background image of the target interface design drawing, and the background image of the target interface design drawing is cut to obtain multiple background cut images.

[0080] According to the preset cutting size rules, the background image of the target interface design drawing is cut to obtain multiple background cut images, wherein the preset cutting size rules can be rules in xlxs format, and the preset cutting size rules can, for example, include 280×280, 280×280, 280×280, 280×280, 280×280, 280×280, 280×280, 280×280, 280×280, 280×280, that is, by importing the preset cutting size rules, the background image of the target interface design drawing is cut into 9 H5 page cut images.

[0081] In some embodiments, the target interface design drawing is imported into the preset design software. After the background layer of the target interface design drawing is selected, the design software reads the size information of the background image of the target interface design drawing and marks the background image of the target interface design drawing as the image to be cut.

[0082] It is worth mentioning that the design software supports importing preset cutting size rules in xlsx format. By reading the length and width of the required batch cutting and cutting the background image of the target interface design drawing with one click, it can complete the image cutting under a single size specification, and the completed cutting can be arranged in layer order from top to bottom.

[0083] S402: Determine size constraints of multiple background cutouts according to the preset software application and scene information of the target application scene.

[0084] The size constraints of background cutouts are different for different software applications and different application scenarios, and the size constraints have a corresponding relationship with the software applications and application scenarios.

[0085] According to the scene information of the preset software application and the target application scene, the corresponding relationship is queried to determine the size constraints of multiple background cut images under the preset software application and the target application scene. The size constraints are used to indicate the adaptation size of the background cut images for the preset software application and the target application scene.

[0086] S403 : scaling and adapting the multiple background cutouts according to size constraints of the multiple background cutouts to obtain multiple scaled cutouts.

[0087] According to the size constraints of the multiple background cut images, the multiple background cut images are scaled respectively to obtain multiple scaled cut images corresponding to the multiple background cut images, where one background cut image corresponds to one scaled cut image.

[0088] In some embodiments, multiple background cutouts are selected, and size constraints for the multiple background cutouts under the scene information of the preset software application and the target application scene are imported. The multiple background cutouts are matched one-to-one with the size constraints of the multiple background cutouts, and the multiple background cutouts are scaled and adapted to obtain multiple scaled cutouts. The size constraints can be the length and width of each background cutout from top to bottom.

[0089] In an optional embodiment, the above step S403, scaling and adapting the multiple background cutouts according to the size constraints of the multiple background cutouts to obtain the multiple scaled cutouts, may include:

[0090] Divide the multiple zoomed slices into regions respectively to obtain multiple visual content regions of each zoomed slice;

[0091] According to the size constraint of the corresponding background cut image, non-core content areas outside the core visual content area in the multiple visual content areas are scaled to obtain corresponding scaled cut images.

[0092] Multiple zoomed images are divided into regions to obtain multiple visual content regions of each zoomed image. The multiple visual content regions may include: upper, middle, and lower regions. For example, the image size of the zoomed image is 100 (pixels) long × 300 (pixels) wide, and 10% of the length is set as the upper and lower regions, and 80% of the length is set as the middle region. That is, the upper and lower parts of the zoomed image are 100×10%=10 (pixels) apart, and the middle part is 80 (pixels) apart.

[0093] Then, the core visual area and non-core visual area are determined from multiple visual areas, where the core visual area can be the upper and lower areas, and the non-core visual area can be the middle area. It is worth noting that the core area refers to the safe area (non-stretchable area), and the non-core area refers to the stretchable area. Usually, the upper and lower areas of the background cut image carry core visual elements such as titles and bottom textures, and the middle area is non-core visual elements such as gradients or solid colors. Therefore, the core visual area and non-core visual area can be identified through dynamic areas, where the upper and lower areas can be core visual content areas, and these two pictures will become a locked safe area. When stretching is performed subsequently, these two pictures will not be stretched. The middle area can be the non-core visual content area. When stretching is performed subsequently, the middle area will be stretched.

[0094] According to the size constraint of the background cut image corresponding to the scaled cut image, the non-core content area outside the core visual content area in the multiple visual content areas is scaled to obtain the corresponding scaled cut image, wherein scaling in the non-core content area refers to scaling the non-core content area in the height direction, that is, the width remains unchanged and is consistent with the width of the core content area. By stretching or shrinking the non-core content area, the scaled cut image after stretching or shrinking satisfies the size constraint, thereby achieving vertical extension or reduction of the image.

[0095] S404: Obtain a resource map of the interface to be adapted according to the multiple zoomed slices.

[0096] Among them, the interface resource map to be adapted may include multiple zoom cut images, and the visual elements in the interface resource map to be adapted include the visual elements corresponding to each zoom cut image. That is to say, the visual elements corresponding to each zoom cut image are matched and positioned, and the layout of the visual elements in each zoom cut image is adapted and adjusted so that the visual elements in each zoom cut image can be adapted and displayed according to the target application scenario of the preset software application to avoid image distortion.

[0097] That is to say, in response to the problem that related technologies may cause deformation or loss of corresponding visual elements after adjusting the size of non-core content areas, based on this, a scaled cut image is obtained through background cut image, and the layout of the corresponding visual elements of the scaled cut image in the scaled cut image is adapted and adjusted to obtain the target interface resource map.

[0098] In this embodiment, there is no need to manually cut the image for batch segmentation and adaptation, and the image can be quickly cut from a single-size background and vertically extended to improve efficiency without deforming the core visual content. In addition, through batch positioning of visual elements, the position logic of custom visual elements in the resource map of the interface to be adapted is supported.

[0099] Figure 7 This is a structural diagram of the image adaptation device provided in an embodiment of the present application, which can be integrated into an electronic device.

[0100] like Figure 7 As shown, the device may include:

[0101] An identification module 501 is configured to perform visual identification on a to-be-adapted interface resource graph of a preset software application, and obtain a target element label of at least one visual element in the to-be-adapted interface resource graph;

[0102] An acquisition module 502 is configured to acquire target adaptation information of the to-be-adapted interface resource graph in a target application scenario of the preset software application according to a target element tag of the at least one visual element;

[0103] The processing module 503 is configured to adapt and adjust the layout of the at least one visual element in the to-be-adapted interface resource map according to the target adaptation information, so as to obtain a target interface resource map of the preset software application in the target application scenario.

[0104] In an optional implementation, the target adaptation information includes: element position, element size, and image size; the processing module 503 is specifically configured to:

[0105] Scaling the to-be-adapted interface resource map according to the image size to obtain a scaled interface resource map;

[0106] According to the element positions and element sizes, corresponding visual elements are laid out in the scaled interface resource graph to obtain the target interface resource graph.

[0107] In an optional implementation, the acquisition module 502 is specifically configured to:

[0108] According to the target element tag of the at least one visual element and the device information of the target display device corresponding to the preset software application, the target adaptation information of the to-be-adapted interface resource graph in the target application scenario is obtained.

[0109] In an optional implementation, the acquisition module 502 is specifically configured to:

[0110] Determining a target adaptation item from a preset adaptation specification according to the scenario information of the target application scenario and the device information of the target display device;

[0111] The target adaptation information is determined from the target adaptation entry according to the target element tag of the at least one visual element.

[0112] In an optional implementation, the acquisition module 502 is specifically configured to:

[0113] In response to the adaptation information acquisition operation for the to-be-adapted interface resource image, a preset adaptation information acquisition plug-in is called to acquire the target adaptation information according to the target element tag of the at least one visual element.

[0114] In an optional implementation, the processing module 503 is specifically configured to:

[0115] In response to an adaptation triggering operation on the to-be-adapted interface resource graph, the layout of the at least one visual element in the to-be-adapted interface resource graph is adapted and adjusted according to the target adaptation information to obtain the target interface resource graph.

[0116] In an optional implementation, the identification module 501 is specifically configured to:

[0117] Perform background cutting on the target interface design drawing to obtain multiple background cutting images;

[0118] Determining size constraints of the plurality of background cutouts respectively according to the preset software application and the scene information of the target application scene;

[0119] scaling the multiple background cutouts according to size constraints of the multiple background cutouts to obtain multiple scaled cutouts;

[0120] The interface resource map to be adapted is obtained according to the multiple zoomed slice maps.

[0121] In an optional implementation, the identification module 501 is specifically configured to:

[0122] Dividing the multiple zoomed cut images into regions respectively to obtain multiple visual content regions of each zoomed cut image;

[0123] According to the size constraint of the corresponding background cut image, non-core content areas outside the core visual content area of the multiple visual content areas are scaled to obtain a corresponding scaled cut image.

[0124] In this embodiment, the identification module is used to visually identify the interface resource map to be adapted of the preset software application and obtain the target element label of at least one visual element in the interface resource map to be adapted. The acquisition module is used to obtain the target adaptation information of the interface resource map to be adapted in the target application scenario of the preset software application based on the target element label of the at least one visual element. The processing module is used to adapt and adjust the layout of the at least one visual element in the interface resource map to be adapted based on the target adaptation information to obtain the target interface resource map of the preset software application in the target application scenario. This achieves batch positioning of at least one visual element, allowing at least one visual element to be adapted and displayed for different application scenarios to avoid image distortion.

[0125] Figure 6 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application, such as Figure 6 As shown, the device may include: a processor 601, a memory 602, and a bus 603. The memory 602 stores machine-readable instructions executable by the processor 601. When the electronic device is running, the processor 601 communicates with the memory 602 via the bus 603. The processor 601 executes the machine-readable instructions to perform the following steps:

[0126] Performing visual recognition on a to-be-adapted interface resource graph of a preset software application to obtain a target element label of at least one visual element in the to-be-adapted interface resource graph;

[0127] Obtaining target adaptation information of the to-be-adapted interface resource graph in a target application scenario of a preset software application according to a target element tag of at least one visual element;

[0128] According to the target adaptation information, the layout of at least one visual element in the to-be-adapted interface resource map is adapted and adjusted to obtain a target interface resource map of the preset software application in the target application scenario.

[0129] In an optional embodiment, the target adaptation information includes: element position, element size, and image size;

[0130] Adapting and adjusting the layout of at least one visual element in the to-be-adapted interface resource map according to the target adaptation information to obtain a target interface resource map for the preset software application in the target application scenario, including:

[0131] According to the image size, the interface resource map to be adapted is scaled to obtain the scaled interface resource map;

[0132] According to the element position and element size, the corresponding visual elements are laid out in the scaled interface resource map to obtain the target interface resource map.

[0133] In an optional embodiment, obtaining target adaptation information of the to-be-adapted interface resource graph in a target application scenario of a preset software application according to a target element tag of at least one visual element includes:

[0134] According to the target element tag of at least one visual element and the device information of the target display device corresponding to the preset software application, target adaptation information of the to-be-adapted interface resource graph in the target application scenario is obtained.

[0135] In an optional embodiment, obtaining target adaptation information of the to-be-adapted interface resource graph in a target application scenario based on the target element tag of at least one visual element and device information of a target display device corresponding to a preset software application includes:

[0136] Determine target adaptation items from a preset adaptation specification based on scenario information of a target application scenario and device information of a target display device;

[0137] Target adaptation information is determined from target adaptation entries according to a target element tag of at least one visual element.

[0138] In an optional embodiment, obtaining target adaptation information of the to-be-adapted interface resource graph in a target application scenario of a preset software application according to a target element tag of at least one visual element includes:

[0139] In response to an adaptation information acquisition operation for a resource image of an interface to be adapted, a preset adaptation information acquisition plug-in is called to acquire target adaptation information according to a target element tag of at least one visual element.

[0140] In an optional embodiment, according to the target adaptation information, the layout of at least one visual element in the to-be-adapted interface resource map is adapted and adjusted to obtain a target interface resource map for the preset software application in the target application scenario, including:

[0141] In response to an adaptation triggering operation on the to-be-adapted interface resource graph, the layout of at least one visual element in the to-be-adapted interface resource graph is adapted and adjusted according to target adaptation information to obtain a target interface resource graph.

[0142] In an optional embodiment, visual recognition is performed on a to-be-adapted interface resource graph of a preset software application to obtain a target element label of at least one visual element in the to-be-adapted interface resource graph, including:

[0143] Perform background cutting on the target interface design drawing to obtain multiple background cutting images;

[0144] Determine size constraints for multiple background cutouts based on the preset software application and scene information of the target application scene;

[0145] According to the size constraints of the multiple background slices, the multiple background slices are scaled respectively to obtain multiple scaled slices;

[0146] Based on multiple zoom and cut images, obtain the resource image of the interface to be adapted.

[0147] In an optional embodiment, the multiple background cutouts are scaled according to the size constraints of the multiple background cutouts to obtain multiple scaled cutouts, including:

[0148] Divide the multiple zoomed slices into regions respectively to obtain multiple visual content regions of each zoomed slice;

[0149] According to the size constraint of the corresponding background cut image, non-core content areas outside the core visual content area in the multiple visual content areas are scaled to obtain corresponding scaled cut images.

[0150] In this embodiment, a processor executes machine-readable instructions to perform visual recognition of a to-be-adapted interface resource graph of a preset software application, obtain a target element tag for at least one visual element in the to-be-adapted interface resource graph, obtain target adaptation information for the to-be-adapted interface resource graph in a target application scenario of the preset software application based on the target element tag of the at least one visual element, and adapt and adjust the layout of the at least one visual element in the to-be-adapted interface resource graph based on the target adaptation information to obtain a target interface resource graph for the at least one visual element in the target application scenario of the preset software application. This enables batch positioning of the at least one visual element, enabling the at least one visual element to be displayed adaptively for different application scenarios, thereby avoiding image distortion.

[0151] The present application also provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the following steps are performed:

[0152] Performing visual recognition on a to-be-adapted interface resource graph of a preset software application to obtain a target element label of at least one visual element in the to-be-adapted interface resource graph;

[0153] Obtaining target adaptation information of the to-be-adapted interface resource graph in a target application scenario of a preset software application according to a target element tag of at least one visual element;

[0154] According to the target adaptation information, the layout of at least one visual element in the to-be-adapted interface resource map is adapted and adjusted to obtain a target interface resource map of the preset software application in the target application scenario.

[0155] In an optional embodiment, the target adaptation information includes: element position, element size, and image size;

[0156] Adapting and adjusting the layout of at least one visual element in the to-be-adapted interface resource map according to the target adaptation information to obtain a target interface resource map for the preset software application in the target application scenario, including:

[0157] According to the image size, the interface resource map to be adapted is scaled to obtain the scaled interface resource map;

[0158] According to the element position and element size, the corresponding visual elements are laid out in the scaled interface resource map to obtain the target interface resource map.

[0159] In an optional embodiment, obtaining target adaptation information of the to-be-adapted interface resource graph in a target application scenario of a preset software application according to a target element tag of at least one visual element includes:

[0160] According to the target element tag of at least one visual element and the device information of the target display device corresponding to the preset software application, target adaptation information of the to-be-adapted interface resource graph in the target application scenario is obtained.

[0161] In an optional embodiment, obtaining target adaptation information of the to-be-adapted interface resource graph in a target application scenario based on the target element tag of at least one visual element and device information of a target display device corresponding to a preset software application includes:

[0162] Determine target adaptation items from a preset adaptation specification based on scenario information of a target application scenario and device information of a target display device;

[0163] Target adaptation information is determined from target adaptation entries according to a target element tag of at least one visual element.

[0164] In an optional embodiment, obtaining target adaptation information of the to-be-adapted interface resource graph in a target application scenario of a preset software application according to a target element tag of at least one visual element includes:

[0165] In response to an adaptation information acquisition operation for a resource image of an interface to be adapted, a preset adaptation information acquisition plug-in is called to acquire target adaptation information according to a target element tag of at least one visual element.

[0166] In an optional embodiment, according to the target adaptation information, the layout of at least one visual element in the to-be-adapted interface resource map is adapted and adjusted to obtain a target interface resource map for the preset software application in the target application scenario, including:

[0167] In response to an adaptation triggering operation on the to-be-adapted interface resource graph, the layout of at least one visual element in the to-be-adapted interface resource graph is adapted and adjusted according to target adaptation information to obtain a target interface resource graph.

[0168] In an optional embodiment, visual recognition is performed on a to-be-adapted interface resource graph of a preset software application to obtain a target element label of at least one visual element in the to-be-adapted interface resource graph, including:

[0169] Perform background cutting on the target interface design drawing to obtain multiple background cutting images;

[0170] Determine size constraints for multiple background cutouts based on the preset software application and scene information of the target application scene;

[0171] According to the size constraints of the multiple background slices, the multiple background slices are scaled respectively to obtain multiple scaled slices;

[0172] Based on multiple zoom and cut images, obtain the resource image of the interface to be adapted.

[0173] In an optional embodiment, the multiple background cutouts are scaled according to the size constraints of the multiple background cutouts to obtain multiple scaled cutouts, including:

[0174] Divide the multiple zoomed slices into regions respectively to obtain multiple visual content regions of each zoomed slice;

[0175] According to the size constraint of the corresponding background cut image, non-core content areas outside the core visual content area in the multiple visual content areas are scaled to obtain corresponding scaled cut images.

[0176] In this embodiment, a computer program, when executed by a processor, visually identifies a to-be-adapted interface resource graph of a preset software application, obtains a target element tag for at least one visual element in the to-be-adapted interface resource graph, obtains target adaptation information for the to-be-adapted interface resource graph in a target application scenario of the preset software application based on the target element tag of the at least one visual element, and adapts and adjusts the layout of the at least one visual element in the to-be-adapted interface resource graph based on the target adaptation information to obtain a target interface resource graph for the at least one visual element in the target application scenario of the preset software application. This achieves batch positioning of the at least one visual element, enabling the at least one visual element to be displayed adaptively for different application scenarios, thereby avoiding image distortion.

[0177] In the embodiment of the present application, the computer program can also execute other machine-readable instructions when run by the processor to execute other methods described in the embodiment. For the specific execution method steps and principles, please refer to the description of the embodiment and will not be repeated here.

[0178] In the embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are merely schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some communication interface, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0179] The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected to achieve the purpose of this embodiment according to actual needs.

[0180] In addition, each functional unit in the embodiments provided in the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.

[0181] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0182] It should be noted that similar numbers and letters represent similar items in the following figures. Therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures. In addition, the terms "first", "second", "third", etc. are only used to distinguish the description and are not to be understood as indicating or implying relative importance.

[0183] Finally, it should be noted that the above-described embodiments are only specific implementation methods of the present application, which are used to illustrate the technical solutions of the present application, rather than to limit them. The scope of protection of the present application is not limited thereto. Although the present application has been described in detail with reference to the above-described embodiments, those skilled in the art should understand that any person skilled in the art can modify or easily conceive of changes to the technical solutions described in the above-described embodiments within the technical scope disclosed in the present application, or make equivalent replacements for some of the technical features thereof. However, these modifications, changes, or replacements do not deviate from the spirit and scope of the technical solutions of the embodiments of the present application. They should all be included in the scope of protection of the present application. Therefore, the scope of protection of the present application should be based on the scope of protection of the claims.

Claims

1. A picture adaptation method, characterized in that: include: Performing visual recognition on a to-be-adapted interface resource graph of a preset software application to obtain a target element label of at least one visual element in the to-be-adapted interface resource graph; According to the target element tag of the at least one visual element, obtaining target adaptation information of the to-be-adapted interface resource graph in the target application scenario of the preset software application; According to the target adaptation information, the layout of the at least one visual element in the to-be-adapted interface resource map is adapted and adjusted to obtain a target interface resource map for the preset software application in the target application scenario.

2. The method according to claim 1, characterized in that The target adaptation information includes: element position, element size and image size; Adapting and adjusting the layout of the at least one visual element in the to-be-adapted interface resource map according to the target adaptation information to obtain a target interface resource map for the preset software application in the target application scenario includes: Scaling the to-be-adapted interface resource map according to the image size to obtain a scaled interface resource map; According to the element positions and element sizes, corresponding visual elements are laid out in the scaled interface resource graph to obtain the target interface resource graph.

3. The method according to claim 1, characterized in that The acquiring, according to the target element tag of the at least one visual element, target adaptation information of the to-be-adapted interface resource graph in the target application scenario of the preset software application includes: According to the target element tag of the at least one visual element and the device information of the target display device corresponding to the preset software application, the target adaptation information of the to-be-adapted interface resource graph in the target application scenario is obtained.

4. The method according to claim 3, characterized in that The acquiring, based on the target element tag of the at least one visual element and the device information of the target display device corresponding to the preset software application, the target adaptation information of the to-be-adapted interface resource graph in the target application scenario includes: Determining a target adaptation item from a preset adaptation specification according to the scenario information of the target application scenario and the device information of the target display device; The target adaptation information is determined from the target adaptation entry according to the target element tag of the at least one visual element.

5. The method according to claim 1, wherein The acquiring, according to the target element tag of the at least one visual element, target adaptation information of the to-be-adapted interface resource graph in the target application scenario of the preset software application includes: In response to the adaptation information acquisition operation for the to-be-adapted interface resource image, a preset adaptation information acquisition plug-in is called to acquire the target adaptation information according to the target element tag of the at least one visual element.

6. The method according to claim 1, characterized in that Adapting and adjusting the layout of the at least one visual element in the to-be-adapted interface resource map according to the target adaptation information to obtain a target interface resource map for the preset software application in the target application scenario includes: In response to an adaptation triggering operation on the to-be-adapted interface resource graph, the layout of the at least one visual element in the to-be-adapted interface resource graph is adapted and adjusted according to the target adaptation information to obtain the target interface resource graph.

7. The method according to claim 1, characterized in that The visual recognition of the to-be-adapted interface resource graph of the preset software application to obtain a target element label of at least one visual element in the to-be-adapted interface resource graph includes: Perform background cutting on the target interface design drawing to obtain multiple background cutting images; Determining size constraints of the plurality of background cutouts respectively according to the preset software application and the scene information of the target application scene; scaling the multiple background cutouts according to size constraints of the multiple background cutouts to obtain multiple scaled cutouts; The interface resource map to be adapted is obtained according to the multiple zoomed slice maps.

8. The method according to claim 7, characterized in that The step of scaling the multiple background cutouts according to the size constraints of the multiple background cutouts to obtain multiple scaled cutouts includes: Dividing the multiple zoomed cut images into regions respectively to obtain multiple visual content regions of each zoomed cut image; According to the size constraint of the corresponding background cut image, non-core content areas outside the core visual content area of the multiple visual content areas are scaled to obtain a corresponding scaled cut image.

9. A picture adaptation device, characterized in that: include: An identification module, configured to perform visual identification on a to-be-adapted interface resource graph of a preset software application, and obtain a target element label of at least one visual element in the to-be-adapted interface resource graph; An acquisition module, configured to acquire target adaptation information of the to-be-adapted interface resource graph in a target application scenario of the preset software application according to a target element tag of the at least one visual element; A processing module is used to adapt and adjust the layout of the at least one visual element in the to-be-adapted interface resource map according to the target adaptation information, so as to obtain a target interface resource map for the preset software application in the target application scenario.

10. An electronic device, characterized in that: include: A processor, a memory, and a bus, wherein the memory stores machine-readable instructions executable by the processor, and when the electronic device is running, the processor and the memory communicate via the bus, and the processor executes the machine-readable instructions to perform the method according to any one of claims 1 to 8.

11. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 8 is executed.