Color editing method and device for virtual clothes, electronic equipment and storage medium
By using different color spaces (such as HSL or HSV) in virtual clothing for color editing and determining the corresponding coloring mode, the problem of difficulty in setting color of virtual clothing in the prior art is solved, and the user experience is improved.
Patent Information
- Application Number
- CN202311762102.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-19
- Publication Date
- 2025-01-10
AI Technical Summary
The existing virtual clothing color editing scheme is difficult for users to set color, and it is difficult for users to adjust color parameters accurately, resulting in poor experience.
Use a different color space than virtual clothing to edit color, and determine the corresponding shading mode for rendering according to user operations, such as using HSL or HSV color space instead of RGB space, providing intuitive hue, saturation and brightness adjustment methods.
Users can quickly understand the impact of each parameter on the final color, and the adjustment is more convenient and accurate, which improves the experience of the virtual clothing dyeing function.
Smart Images

Figure CN119295571A_ABST
Abstract
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 color editing of virtual clothing. Background Art
[0002] In existing games or virtual communities, virtual clothing generally supports users to perform various personalized designs on fashion, such as modifying clothing color (dyeing), material, pattern, applying decals to fashion, etc. Clothing dyeing generally includes two methods: color replacement and color superposition.
[0003] In the clothing editing mode, virtual clothing and its coloring methods generally use the same color space as color editing. For example, virtual clothing and its coloring methods in the game use RGB (red, green, blue three color channels) method. Therefore, in the clothing editing mode, clothing dyeing generally also uses RGB method, that is, providing users with an interface for adjusting clothing colors. On the interface, users can set clothing colors by adjusting the parameters of the three colors R, G, and B respectively.
[0004] The existing dyeing schemes make it difficult for users to set colors. It is difficult for general users to accurately know the color component parameters corresponding to the color they want to set. Even if users can be provided with sliders or other methods to adjust the color component parameters, since each parameter needs to be adjusted separately, it is difficult for users to know the impact that adjusting each parameter may have on the final color. Therefore, the color setting of the existing dyeing scheme is not user-friendly. Users will spend a lot of time and energy adjusting parameters, and may not necessarily get the color they are satisfied with, so users have a poor experience in clothing dyeing. Summary of the invention
[0005] In order to solve the above technical problems or at least partially solve the above technical problems, the embodiments of the present application provide a method, device, electronic device and storage medium for color editing of virtual clothing.
[0006] According to one aspect of an embodiment of the present application, a method for editing the color of a virtual costume is provided, comprising:
[0007] After the virtual clothing enters the color editing mode, the editing color of the virtual clothing is determined according to the first color editing operation of the user on the color editing control; the color space of the virtual clothing is the first color space; the color editing control is the color editing control corresponding to the second color space, and the first color space is different from the second color space;
[0008] Determining a coloring mode corresponding to the virtual clothing;
[0009] The virtual clothing is rendered using the shading mode according to the edited color.
[0010] According to another aspect of an embodiment of the present application, a device for editing the color of a virtual clothing is provided, comprising:
[0011] A color editing module is used to determine the editing color of the virtual clothing according to a first color editing operation of the user on the color editing control after the virtual clothing enters the color editing mode; the color space of the virtual clothing is a first color space; the color editing control is a color editing control corresponding to a second color space, and the first color space is different from the second color space;
[0012] A coloring determination module, used to determine a coloring mode corresponding to the virtual clothing;
[0013] A rendering module is used to render the virtual clothing according to the edited color and using the shading mode.
[0014] According to another aspect of an embodiment of the present application, a storage medium is further provided, which includes a stored program, and the above steps are executed when the program is run.
[0015] According to another aspect of the embodiment of the present application, there is provided an electronic device, comprising: a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus;
[0016] The memory is used to store computer programs;
[0017] The processor is used to implement the above method steps when executing a computer program.
[0018] According to another aspect of an embodiment of the present application, a computer-readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the above method steps are implemented.
[0019] The above technical solution provided by the embodiment of the present application has the following advantages compared with the prior art:
[0020] In the embodiment of the present application, a color space different from that of the virtual clothing is used to implement the color editing of the clothing, and a corresponding coloring mode is used to render the virtual clothing after color editing. In this way, when the user adjusts the color parameters of the clothing, he can quickly know the impact of adjusting each parameter on the final color, and the user can adjust the color of the virtual clothing more conveniently and accurately. , thereby improving the user's experience of the clothing dyeing function BRIEF DESCRIPTION OF THE DRAWINGS
[0021] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and, together with the description, serve to explain the principles of the invention.
[0022] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0023] Figure 1 A flowchart of a method for editing the color of virtual clothing provided in an embodiment of the present application;
[0024] Figure 2 A schematic diagram of a color editing interface provided in an embodiment of the present application;
[0025] Figure 3 A flowchart of a method for editing the color of virtual clothing provided by another embodiment of the present application;
[0026] Figure 4 A flowchart of a method for editing the color of virtual clothing provided by another embodiment of the present application;
[0027] Figure 5 A flowchart of a method for editing the color of virtual clothing provided by another embodiment of the present application;
[0028] Figure 6 A flowchart of a method for editing the color of virtual clothing provided by another embodiment of the present application;
[0029] Figure 7 A flowchart of a method for editing the color of virtual clothing provided by another embodiment of the present application;
[0030] Figure 8 A flowchart of a method for editing the color of virtual clothing provided by another embodiment of the present application;
[0031] Fig. 9 A flowchart of a method for editing the color of virtual clothing provided by another embodiment of the present application;
[0032] Fig.10 A schematic diagram of the structure of a color editing device for virtual clothing provided in an embodiment of the present application;
[0033] Fig.11 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0034] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution 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 part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.
[0035] In addition to color spaces such as RGB and CMY that are defined based on specific colors, there are also color spaces such as HSL and HSV, which use hue, saturation, and brightness (or lightness) to describe colors based on the human visual system. Because they re-map the RGB model, they are more visually intuitive than the RGB model. HSL (also known as HSI) is hue, saturation, and lightness / intensity; HSV (also known as HSB) is hue, saturation, and value / brightness.
[0036] Therefore, in the embodiment of the present application, in the game, when the user dyes the clothing, the color adjustment and virtual clothing use different color spaces and are rendered using corresponding coloring methods. If the virtual clothing and its coloring method use RGB, the color editing adjustment can provide the user with HSL, HSV and other color adjustment methods, so that the user can quickly and accurately adjust the color of the clothing.
[0037] First, a color editing method for virtual clothing provided by an embodiment of the present invention is introduced below.
[0038] Figure 1 A flowchart of a method for editing the color of virtual clothing provided in an embodiment of the present application. Figure 1 As shown, the method includes the following steps S11-S13:
[0039] Step S11, after the virtual clothing enters the color editing mode, the editing color of the virtual clothing is determined according to the user's first color editing operation on the color editing control; the color space of the virtual clothing is the first color space; the color editing control is a color editing control corresponding to the second color space, and the first color space is different from the second color space.
[0040] The first color space may be a color space defined by multiple colors, such as RGB, CMY, CMYK, etc. The second color space may be a color space defined by cylindrical coordinates, such as HSL, HSV, etc. Different color spaces correspond to different coloring modes, the first color space corresponds to the first coloring mode, and the second color space corresponds to the second coloring mode.
[0041] Step S12, determining the coloring mode corresponding to the virtual clothing.
[0042] The coloring mode corresponding to the virtual clothing can determine whether the coloring mode is the first coloring mode or the second coloring mode according to factors such as the color edited by the user, the color editing type, and the edited clothing area.
[0043] Step S13, rendering the virtual clothing in a shading mode according to the edited color.
[0044] In this embodiment, a color space different from that of the virtual clothing is used to implement the color editing of the clothing, and a corresponding coloring mode is used to render the virtual clothing after color editing. In this way, when the user adjusts the color parameters of the clothing, he can quickly know the impact of adjusting each parameter on the final color, and the user can adjust the color of the virtual clothing more conveniently and accurately, thereby improving the user's experience of the clothing dyeing function.
[0045] Since virtual clothing generally uses the RGB color space, the HSL color space can be used to facilitate users to edit the color of virtual clothing. Figure 2 As shown in the figure, on the color editing interface of virtual clothing, color editing controls corresponding to the HSL color space are provided: adjustment sliders corresponding to "hue" (H), "saturation" (S) and "lightness" (L). Users can adjust the H, S, and L parameters of the clothing color by dragging the sliders. By adjusting the "hue" slider, different colors can be determined, such as bright red, ordinary blue, lemon yellow, silver gray, etc. The value range of H can be 0°-360°. By adjusting the "saturation" slider, the vividness of the color can be adjusted, and the value range of S can be 0-100%. By adjusting the "lightness" slider, the brightness of the color can be adjusted, and the value range of L can also be 0-100%.
[0046] There may be a certain correspondence between the H, S, and L adjustment slider parameter ranges and the H, S, and L value ranges. For example, if the H and S adjustment slider parameter ranges are 0 to 1, the corresponding H value range is 0°-360°, and the S value range is 0-100%; if the L adjustment slider parameter range is -1 to 1, the corresponding L value range is 0-100%.
[0047] In different color editing types, the H, S, and L adjustment slider parameter ranges can be different. For example, in color replacement mode, the H and S adjustment slider parameter ranges are 0 to 1, and the L adjustment slider parameter range is -1 to 1; in color overlay mode, the H adjustment slider parameter range is -0.5 to 0.5, and the S and L adjustment slider parameter ranges are -1 to 1.
[0048] Compared with the RGB color space, the HSL (or HSV) color space has a more intuitive connection between the color component values and the generated color. For users, the HSL (or HSV) color space is more similar to the way humans perceive color, giving users more familiar color information such as "what color is this" (hue), "how dark it is" (saturation), and "how light and dark it is" (brightness), making it easier for users to adjust colors based on the three components of hue, saturation, and brightness.
[0049] like Figure 2 As shown, on the color editing interface of the virtual clothing, the user can select the current color editing type as "dying" (i.e., color replacement or color overlay) or "overlay" (i.e., color superposition). Under different color editing types, color editing methods in different color spaces can be provided to the user. For example, under "dying", RGB color editing controls are provided, and under "overlay", HSL color editing controls are provided; or, under different color editing types, HSL color editing controls are provided to the user.
[0050] The color adjustment of virtual clothing can be overall or regional. Since the color adjustment of virtual clothing can use different color spaces, different shading modes can be used in subsequent rendering.
[0051] In an alternative embodiment, if Figure 3 As shown, the above step S12 includes:
[0052] Step S21, detecting a user's second color editing operation on the virtual clothing;
[0053] Step S22, determine the coloring mode corresponding to the second color editing operation; wherein the coloring mode includes a first coloring mode or a second coloring mode; the first coloring mode is a coloring mode corresponding to the first color space, and the second coloring mode is a coloring mode of the second color space.
[0054] Optionally, the user's second color editing operation may include: selecting a color editing type, such as color replacement or color overlay; selecting a clothing area for color editing, which clothing area may have been adapted to a coloring pattern, or a coloring pattern may be matched according to the color of the clothing area; and the like.
[0055] The following is a detailed description of how to determine the coloring mode based on different factors.
[0056] (I) Color editing type
[0057] In an alternative embodiment, if Figure 4 As shown, the above step S22 includes:
[0058] Step S31, determining the color editing type of the virtual clothing according to the second color editing operation; wherein the color editing type includes color replacement or color overlay;
[0059] Step S32, selecting a coloring mode according to the color editing type.
[0060] When the color editing type is color replacement (or color overlay), such as Figure 2 As shown, when the user selects "coloring", the coloring mode can select the first coloring mode or the second coloring mode, such as RGB or HSL coloring mode.
[0061] When the color editing type is color overlay, such as Figure 2 As shown, when the user selects "overlay color", the coloring mode can select a second coloring mode, such as the HSL coloring mode.
[0062] When the HSL coloring mode is used for color replacement, the final H and S values of the virtual clothing are the H and S values of the color edited by the user, and the final L value can be set to the sum of the L value corresponding to the current color of the virtual clothing and the L value of the color edited by the user. When the HSL coloring mode is used for color superposition, the H, S, L values of the color edited by the user are superimposed on the H, S, L values corresponding to the current color of the virtual clothing, and the final H, S, L values of the virtual clothing are the sum of the H, S, L values of the color edited by the user and the H, S, L values corresponding to the current color of the virtual clothing.
[0063] In an alternative embodiment, if Figure 2 As shown, the user can also choose to use the "preset" color to edit the clothing color. In the "preset" mode, multiple colors are provided to the user, and the user can directly select the color. For the color editing type where the user directly selects the color, the first coloring mode, such as the RGB coloring mode, can be used.
[0064] In an optional embodiment, since the resource types of virtual clothing may also be different, such as the virtual clothing is PGC (Professional Generated Content) clothing or UGC (User Generated Content) white model clothing, virtual clothing of different resource types may use different coloring modes under different color editing types.
[0065] For PGC clothing, when replacing or overlaying colors, users can edit colors based on the HSL method, and also select the HSL shading mode when rendering; in the color editing type where the user directly selects the color, the RGB shading mode or the HSL shading mode can be used.
[0066] For UGC white model clothing, when replacing colors or overlaying colors, users can edit colors based on the HSL method, and when rendering, they can use the first shading mode, such as the RGB shading mode. At this time, the colors edited by the HSL method need to be converted to the RGB color space before rendering; in the color editing type where the user directly selects the color, the RGB shading mode can be used.
[0067] Since the color space of existing virtual clothing is generally RGB, if the HSL coloring mode is used, the color information of the virtual clothing needs to be converted from RGB to HSL before rendering. Therefore, without affecting the color display, for the color edited by the user in HSL mode, the edited color information is converted from HSL to RGB, and then rendered using the RGB coloring mode, which can relatively reduce the amount of calculation for virtual clothing color editing and reduce system resource usage.
[0068] (II) Clothing area
[0069] In order to edit virtual clothing more carefully, virtual clothing will be divided into multiple areas. For example, virtual clothing will be divided into multiple areas according to structure. For example, the structure of a dress is: sleeves, hem, belt, and upper body, so the dress will be divided into 4 different areas. Different areas of clothing can be edited separately, including editing colors, selecting fabrics, decals, etc.
[0070] Different clothing areas of the virtual clothing can be adapted to corresponding coloring modes, and the coloring mode information can be pre-written into the area information of the clothing area.
[0071] For example, the coloring mode corresponding to the sleeves and belt of the dress is the RGB coloring mode, and the coloring mode corresponding to the hem and upper body is the HSL coloring mode.
[0072] In an alternative embodiment, if Figure 5 As shown, the above step S22 includes:
[0073] Step S41, determining a clothing area of the virtual clothing corresponding to the second color editing operation;
[0074] Step S42, determining a coloring mode according to the clothing area.
[0075] According to the clothing area corresponding to the user operation, the area information of the clothing area is queried to determine the coloring mode corresponding to the clothing area. For example, for a dress, if the area selected by the user to edit the color is the hem, the corresponding coloring mode is the HSL coloring mode.
[0076] For the entire virtual clothing, using HSL shading mode for rendering may result in a large amount of calculation, more system resources, and slower clothing color rendering. Therefore, different shading modes can be used for different areas of virtual clothing. For areas with more color editing and higher color display requirements, HSL shading mode can be set; for areas with less color editing and less impact on the overall display of clothing, RGB shading mode can be set. In this way, the amount of clothing rendering calculation and system resource usage can be reduced to a certain extent, and clothing color rendering can be accelerated. Alternatively, the corresponding shading mode can be set directly according to the area of the clothing area. The larger area is set to HSL shading mode, and the smaller area is set to RGB shading mode, thereby reducing the amount of clothing rendering calculation and system resource usage, and accelerating clothing color rendering.
[0077] In this way, different clothing areas of virtual clothing use different coloring modes, which can reduce the amount of clothing rendering calculations and system resource usage, and avoid a decrease in user experience caused by slow clothing color rendering.
[0078] 3. Clothing area color
[0079] In an optional embodiment, the coloring mode corresponding to the clothing area is not preset, and the coloring mode corresponding to the clothing area can be determined according to the color edited by the user.
[0080] like Figure 6 As shown, the above step S42 includes:
[0081] Step S51, identifying the color information of the clothing area;
[0082] Step S52, determining the coloring mode according to the color information.
[0083] For example, if the color of the clothing area edited by the user is relatively simple, such as a solid color or only containing two colors, the RGB shading mode can be used for rendering; if the color of the clothing area edited by the user is complex, such as many colors or gradient colors, the HSL shading mode can be used for rendering.
[0084] When the user edits simple colors, the RGB coloring mode can be used to reduce the amount of color rendering calculations and system resource usage. However, when the user edits more complex colors, the HSL coloring mode can be used to ensure the color rendering effect of clothing.
[0085] The determination of the virtual clothing coloring mode is not limited to the above factors. The corresponding coloring mode can also be determined based on the type of virtual clothing, the overall clothing color, the clothing style, etc., which will not be repeated here. Under the premise of ensuring the color rendering effect, the clothing rendering calculation amount is reduced as much as possible to avoid occupying system resources.
[0086] In an optional embodiment, the user can divide the virtual clothing into regions by himself, and the corresponding coloring mode can be adapted for the clothing regions divided by the user. Figure 7 As shown, the method further includes: step S14, when detecting a user's area division operation on the virtual clothing, dividing the virtual clothing into at least two clothing areas according to the area division operation.
[0087] The above step S12 includes:
[0088] Step S61, obtaining color information of the clothing area;
[0089] Step S62, determining the coloring mode corresponding to the clothing area according to the color information.
[0090] Users can divide clothing into regions by drawing closed curves to select the areas that need color editing. After users divide clothing regions, the coloring mode corresponding to the clothing region can be automatically adapted according to the color of the clothing region, or the user can be given permission to set or modify the coloring mode. Users can set the coloring mode of the clothing region as needed.
[0091] Optionally, if there are obvious color partitions / boundaries in the selected area, the user-selected area can be automatically divided into different sub-areas, and then the coloring mode of the different sub-areas can be determined.
[0092] In this embodiment, the user can customize the clothing area to edit the color, which improves the personalization of clothing editing and provides a better user experience.
[0093] In an optional embodiment, when the coloring mode is the second coloring mode, such as when the coloring mode is the HSL coloring mode, Figure 8 As shown, the above step S11 includes:
[0094] Step S71, determining a current second color space value corresponding to the edited color according to a first color editing operation of the user on the color editing control;
[0095] The above step S13 includes:
[0096] Step S72, converting the color space of the virtual clothing from the first color space to the second color space, and obtaining the original second color space value corresponding to the virtual clothing;
[0097] Step S73: Rendering the virtual clothing according to the original second color space value and the current second color space value.
[0098] When the shading mode is the second shading mode, the color space of the virtual clothing needs to be converted from the first color space, such as RGB, to the second color space, such as HSL, when rendering the clothing, and then the final H, S, L values of the virtual clothing are determined according to the H, S, L values of the user-edited color and the H, S, L values corresponding to the virtual clothing.
[0099] In an optional embodiment, when the coloring mode is the first coloring mode, such as when the coloring mode is the RGB coloring mode, Fig. 9 As shown, the above step S11 includes:
[0100] Step S81, determining a current second color space value corresponding to the edited color according to a first color editing operation of the color editing control by the user;
[0101] The above step S13 includes:
[0102] Step S82, converting the current second color space value into the current first color space value;
[0103] Step S83: Rendering the virtual clothing according to the current first color space value.
[0104] When the coloring mode is the first coloring mode, the color space of the user edited color is converted from the second color space, such as HSL, to the first color space, such as RGB, and then the final RGB value of the virtual clothing is determined according to the RGB of the user edited color and the RGB value corresponding to the virtual clothing.
[0105] When providing the user with a color editing method corresponding to the second color space, in order to avoid the user's misoperation resulting in rendering of virtual clothing according to invalid color editing results, such as the user mistakenly adjusting the brightness slider to the lowest or highest level, then adjusting the hue or saturation will not change the color of the clothing. Therefore, in an optional embodiment, the color editing control includes a brightness editing control or a brightness editing control; the method further includes:
[0106] When the brightness value is determined to exceed the preset brightness range according to the first color editing operation, the shader is controlled to stop updating the color rendering of the virtual clothing; or when the brightness value is determined to exceed the preset brightness range according to the first color editing operation, the shader is controlled to stop updating the color rendering of the virtual clothing.
[0107] For example, since the value range of the brightness L is preset to be 0-1, the client can pass L=-1 to the shader, so that the shader enters a state of stopping updating color rendering.
[0108] In this way, during the color editing process, if the brightness or luminance value is adjusted outside the preset range, the shader will be controlled to stop updating the rendering of the virtual clothing no matter how the user adjusts the hue or saturation, thereby avoiding the waste of calculation and system resource usage caused by invalid rendering. At the same time, the user can be prompted that the shader is in the "stop updating rendering" state at this time, and the user can also be prompted that "the brightness value is set incorrectly".
[0109] In an optional embodiment, when the user enters the color editing interface of the virtual clothing, the user can set the initial color for the virtual clothing, such as H, S, L = 0, 0, 0. When the user moves any slider of hue, saturation or brightness, the coloring is activated. When the user switches the color editing type, the parameters on the current adjustment slider can be reset.
[0110] A color reset button may also be provided on the color editing interface. When the user needs to re-edit the color, the color of the virtual clothing can be restored to the initial color by clicking the reset button.
[0111] In an optional embodiment, the coloring modes corresponding to different clothing areas of the virtual clothing can be stored by a material ball. The material ball can also store the default colors corresponding to each clothing area. If the default color corresponding to the clothing area cannot be found, H, S, L = 0, 0, 0 can be used as the default color. If the coloring mode corresponding to the clothing area cannot be found, the first coloring mode can be used.
[0112] The following are device embodiments of the present application, which can be used to execute method embodiments of the present application.
[0113] Fig.10 This is a schematic diagram of the structure of a virtual clothing color editing device provided in an embodiment of the present application. The device can be implemented as part or all of an electronic device through software, hardware, or a combination of both. Fig.10 As shown, the color editing device of the virtual clothing includes:
[0114] A color editing module 91 is used to determine the editing color of the virtual clothing according to the first color editing operation of the user on the color editing control after the virtual clothing enters the color editing mode; the color space of the virtual clothing is the first color space; the color editing control is the color editing control corresponding to the second color space, and the first color space is different from the second color space;
[0115] A coloring determination module 92, used to determine a coloring mode corresponding to the virtual clothing;
[0116] The rendering module 93 is used to render the virtual clothing in a shading mode according to the edited color.
[0117] Optionally, a coloring determination module 92 is used to detect a user's second color editing operation on virtual clothing; determine a coloring mode corresponding to the second color editing operation; wherein the coloring mode includes a first coloring mode or a second coloring mode; the first coloring mode is a coloring mode corresponding to a first color space, and the second coloring mode is a coloring mode corresponding to a second color space.
[0118] Optionally, the coloring determination module 92 is used to determine the color editing type of the virtual clothing according to the second color editing operation; wherein the color editing type includes color replacement or color overlay; and select the coloring mode according to the color editing type.
[0119] Optionally, the coloring determination module 92 is used to determine a clothing area of the virtual clothing corresponding to the second color editing operation; and determine a coloring mode according to the clothing area.
[0120] Optionally, the coloring determination module 92 is used to identify color information of the clothing area; and determine a coloring mode according to the color information.
[0121] Optionally, the device further comprises:
[0122] The partitioning module is used for, when detecting a user's area division operation on the virtual clothing, dividing the virtual clothing into at least two clothing areas according to the area division operation;
[0123] The coloring determination module 92 is used to obtain color information of the clothing area and determine the coloring mode corresponding to the clothing area according to the color information.
[0124] Optionally, when the coloring mode is the second coloring mode, the color editing module 91 is used to determine the current second color space value corresponding to the edited color according to the second color editing operation of the color editing control by the user;
[0125] The rendering module 93 is used to convert the color space of the virtual clothing from the first color space to the second color space, obtain the original second color space value corresponding to the virtual clothing, and render the virtual clothing according to the original second color space value and the current second color space value.
[0126] Optionally, when the coloring mode is the first coloring mode, the color editing module 91 is used to determine the current second color space value corresponding to the edited color according to the first color editing operation of the color editing control by the user;
[0127] The rendering module 93 is used to convert the current second color space value into the current first color space value; and render the virtual clothing according to the current first color space value.
[0128] Optionally, the color editing control includes a brightness editing control or a luminance editing control; the device also includes: a control module, used to control the shader to stop updating the color rendering of the virtual clothing when it is determined according to the first color editing operation that the brightness value exceeds a preset brightness range; or, when it is determined according to the first color editing operation that the luminance value exceeds a preset luminance range, control the shader to stop updating the color rendering of the virtual clothing.
[0129] The present application also provides an electronic device, such as Fig.11 As shown, the electronic device may include: a processor 1501 , a communication interface 1502 , a memory 1503 and a communication bus 1504 , wherein the processor 1501 , the communication interface 1502 , and the memory 1503 communicate with each other via the communication bus 1504 .
[0130] Memory 1503, used for storing computer programs;
[0131] The processor 1501 is used to implement the steps of the above method embodiment when executing the computer program stored in the memory 1503.
[0132] The communication bus mentioned in the above electronic device can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The communication bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.
[0133] The communication interface is used for communication between the above electronic device and other devices.
[0134] The memory may include a random access memory (RAM) or a non-volatile memory (NVM), such as at least one disk memory. Optionally, the memory may also be at least one storage device located away from the aforementioned processor.
[0135] The above-mentioned processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
[0136] The present application also provides a computer-readable storage medium having a computer program stored thereon, and the computer program implements the steps of the above method embodiment when executed by a processor.
[0137] It should be noted that, for the above-mentioned device, electronic device and computer-readable storage medium embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiments.
[0138] It should be further noted that, in this article, relational terms such as "first" and "second" are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.
[0139] The above is only a specific implementation of the present application, so that those skilled in the art can understand or implement the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein can be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present application will not be limited to the embodiments shown herein, but will conform to the widest range consistent with the principles and novel features applied for herein.
Claims
1. A method for editing the color of virtual clothing, characterized in that: include: After the virtual clothing enters the color editing mode, the editing color of the virtual clothing is determined according to the first color editing operation of the user on the color editing control; the color space of the virtual clothing is the first color space; the color editing control is the color editing control corresponding to the second color space, and the first color space is different from the second color space; Determining a coloring mode corresponding to the virtual clothing; The virtual clothing is rendered using the shading mode according to the edited color.
2. The method according to claim 1, characterized in that The determining the coloring mode corresponding to the virtual clothing includes: Detecting a second color editing operation of the virtual clothing by a user; Determine a shading mode corresponding to the second color editing operation; wherein the shading mode includes a first shading mode or a second shading mode; the first shading mode is a shading mode corresponding to the first color space, and the second shading mode is a shading mode of the second color space.
3. The method according to claim 2, characterized in that The determining the coloring mode corresponding to the second color editing operation includes: Determining a color editing type for the virtual clothing according to the second color editing operation; wherein the color editing type includes color replacement or color overlay; The coloring mode is selected according to the color editing type.
4. The method according to claim 2, characterized in that: The determining the coloring mode corresponding to the second color editing operation includes: Determining a clothing area of the virtual clothing corresponding to the second color editing operation; The coloring mode is determined according to the clothing area.
5. The method according to claim 4, characterized in that The determining of the coloring mode according to the clothing area includes: Identifying color information of the clothing area; The coloring mode is determined according to the color information.
6. The method according to claim 1, characterized in that Also includes: When detecting a user's area division operation on the virtual clothing, dividing the virtual clothing into at least two clothing areas according to the area division operation; The determining the coloring mode corresponding to the virtual clothing includes: Acquire color information of the clothing area; A coloring mode corresponding to the clothing area is determined according to the color information.
7. The method according to claim 1, characterized in that When the coloring mode is the second coloring mode, determining the edited color of the virtual clothing according to the first color editing operation of the user on the color editing control includes: Determining a current second color space value corresponding to the edited color according to the user's first color editing operation on the color editing control; The rendering of the virtual clothing according to the edited color includes: Converting the color space of the virtual clothing from the first color space to the second color space to obtain an original second color space value corresponding to the virtual clothing; The virtual clothing is rendered according to the original second color space value and the current second color space value.
8. The method according to claim 1, characterized in that When the coloring mode is the first coloring mode, determining the edited color of the virtual clothing according to the first color editing operation of the user on the color editing control includes: Determining a current second color space value corresponding to the edited color according to the user's first color editing operation on the color editing control; The rendering of the virtual clothing according to the edited color includes: Converting the current second color space value to a current first color space value; The virtual clothing is rendered according to the current first color space value.
9. The method according to claim 1, characterized in that: The color editing control includes a brightness editing control or a luminance editing control; the method further includes: When it is determined according to the first color editing operation that the brightness value exceeds a preset brightness range, controlling the shader to stop updating the color rendering of the virtual clothing; or, When it is determined according to the first color editing operation that the brightness value exceeds a preset brightness range, the shader is controlled to stop updating the color rendering of the virtual clothing.
10. A color editing device for virtual clothing, characterized in that: include: A color editing module is used to determine the editing color of the virtual clothing according to a first color editing operation of the user on the color editing control after the virtual clothing enters the color editing mode; the color space of the virtual clothing is a first color space; the color editing control is a color editing control corresponding to a second color space, and the first color space is different from the second color space; A coloring determination module, used to determine a coloring mode corresponding to the virtual clothing; A rendering module is used to render the virtual clothing according to the edited color and using the shading mode.
11. An electronic device, characterized in that: include: A processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus; The memory is used to store computer programs; The processor is used to implement the color editing method of virtual clothing according to any one of claims 1 to 9 when executing the computer program.
12. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the color editing method of virtual clothing described in any one of claims 1 to 9 is implemented.