CN114972593A - Image rendering method, device and non-volatile storage medium - Google Patents
Image rendering method, device and non-volatile storage medium Download PDFInfo
- Publication number
- CN114972593A CN114972593A CN202110202059.9A CN202110202059A CN114972593A CN 114972593 A CN114972593 A CN 114972593A CN 202110202059 A CN202110202059 A CN 202110202059A CN 114972593 A CN114972593 A CN 114972593A
- Authority
- CN
- China
- Prior art keywords
- image
- information
- dimensional grid
- target image
- rendering
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000009877 rendering Methods 0.000 title claims abstract description 105
- 238000000034 method Methods 0.000 title claims abstract description 55
- 238000004422 calculation algorithm Methods 0.000 claims description 24
- 239000011159 matrix material Substances 0.000 claims description 23
- 230000008859 change Effects 0.000 claims description 16
- 230000006870 function Effects 0.000 claims description 12
- 230000001131 transforming effect Effects 0.000 claims description 4
- 230000000694 effects Effects 0.000 description 23
- 238000012545 processing Methods 0.000 description 14
- 239000003086 colorant Substances 0.000 description 8
- 230000008569 process Effects 0.000 description 7
- 230000009471 action Effects 0.000 description 6
- 230000003993 interaction Effects 0.000 description 6
- 238000005381 potential energy Methods 0.000 description 6
- 230000004044 response Effects 0.000 description 6
- 238000010586 diagram Methods 0.000 description 5
- 230000004048 modification Effects 0.000 description 5
- 238000012986 modification Methods 0.000 description 5
- 239000013598 vector Substances 0.000 description 5
- 230000000007 visual effect Effects 0.000 description 5
- 230000005540 biological transmission Effects 0.000 description 4
- 238000004364 calculation method Methods 0.000 description 4
- 238000004891 communication Methods 0.000 description 4
- 238000013461 design Methods 0.000 description 4
- 230000008878 coupling Effects 0.000 description 3
- 238000010168 coupling process Methods 0.000 description 3
- 238000005859 coupling reaction Methods 0.000 description 3
- 238000000605 extraction Methods 0.000 description 3
- 230000002452 interceptive effect Effects 0.000 description 3
- 230000007704 transition Effects 0.000 description 3
- 230000008901 benefit Effects 0.000 description 2
- 238000004590 computer program Methods 0.000 description 2
- 238000005516 engineering process Methods 0.000 description 2
- 230000003287 optical effect Effects 0.000 description 2
- 239000007787 solid Substances 0.000 description 2
- 238000009825 accumulation Methods 0.000 description 1
- 238000013500 data storage Methods 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 230000008676 import Effects 0.000 description 1
- 230000006872 improvement Effects 0.000 description 1
- 230000010354 integration Effects 0.000 description 1
- 239000004973 liquid crystal related substance Substances 0.000 description 1
- 239000000463 material Substances 0.000 description 1
- 238000010295 mobile communication Methods 0.000 description 1
- 238000012805 post-processing Methods 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T15/00—3D [Three Dimensional] image rendering
- G06T15/005—General purpose rendering architectures
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2200/00—Indexing scheme for image data processing or generation, in general
- G06T2200/24—Indexing scheme for image data processing or generation, in general involving graphical user interfaces [GUIs]
Landscapes
- Engineering & Computer Science (AREA)
- Computer Graphics (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- Processing Or Creating Images (AREA)
- Image Generation (AREA)
Abstract
本申请公开了一种图像渲染方法、装置及非易失性存储介质。其中,该方法包括:获取目标图像;从目标图像中确定三维网格,并对三维网格中的点阵信息按照预设规则进行改变,其中,点阵信息包括以下至少之一:点阵的三维坐标,反射强度和颜色信息;基于改变后的点阵信息对三维网格所在的目标图像进行重新渲染,得到渲染图像。本申请解决了现有技术无法生成符合用户需求的动态色彩渲染图的技术问题。
The present application discloses an image rendering method, device and non-volatile storage medium. The method includes: acquiring a target image; determining a three-dimensional grid from the target image, and changing the lattice information in the three-dimensional grid according to a preset rule, wherein the lattice information includes at least one of the following: Three-dimensional coordinates, reflection intensity and color information; based on the changed lattice information, re-render the target image where the three-dimensional grid is located to obtain a rendered image. The present application solves the technical problem that the prior art cannot generate a dynamic color rendering image that meets user requirements.
Description
技术领域technical field
本申请涉及图像处理领域,具体而言,涉及一种图像渲染方法、装置及非易失性存储介质。The present application relates to the field of image processing, and in particular, to an image rendering method, device and non-volatile storage medium.
背景技术Background technique
云产品等高科技产品的设计和展示,经常需要用到一些富有科技感、动态的背景去烘托氛围。但是目前市场上常见的生成动态背景的产品,均存在显示效果单一,且生成动态背景的过程离线完成,与用户无交互,且无法随机生成动态背景或不允许用户进行个性化设置等问题。The design and display of high-tech products such as cloud products often need to use some technological and dynamic backgrounds to enhance the atmosphere. However, the common products on the market that generate dynamic backgrounds all have problems such as single display effect, and the process of generating dynamic backgrounds is completed offline, without interaction with users, and cannot generate dynamic backgrounds randomly or do not allow users to make personalized settings.
针对上述的问题,目前尚未提出有效的解决方案。For the above problems, no effective solution has been proposed yet.
发明内容SUMMARY OF THE INVENTION
本申请实施例提供了一种图像渲染方法、装置及非易失性存储介质,以至少解决现有技术无法生成符合用户需求的动态色彩渲染图的技术问题。Embodiments of the present application provide an image rendering method, device, and non-volatile storage medium, so as to at least solve the technical problem that the prior art cannot generate a dynamic color rendering map that meets user requirements.
根据本申请实施例的一个方面,提供了一种渲染方法,包括:获取目标图像;从目标图像中确定三维网格,并对三维网格中的点阵信息按照预设规则进行改变,其中,点阵信息包括以下至少之一:点阵的三维坐标,反射强度和颜色信息;基于改变后的点阵信息对三维网格所在的目标图像进行重新渲染,得到渲染图像。According to an aspect of the embodiments of the present application, a rendering method is provided, including: acquiring a target image; determining a three-dimensional grid from the target image, and changing the lattice information in the three-dimensional grid according to preset rules, wherein, The lattice information includes at least one of the following: three-dimensional coordinates, reflection intensity and color information of the lattice; and based on the changed lattice information, the target image where the three-dimensional grid is located is re-rendered to obtain a rendered image.
根据本申请实施例的另一方面,还提供了一种图像渲染方法,包括:在编辑界面中展示接收的待编辑图像;以待编辑图像中的三维网格为单位,对待编辑图像中的点阵信息进行改变,其中,点阵信息包括以下至少之一:点阵的三维坐标,反射强度和颜色信息;基于改变后的点阵信息对待编辑图像进行渲染,得到渲染图像。According to another aspect of the embodiments of the present application, an image rendering method is also provided, including: displaying the received image to be edited in an editing interface; The lattice information is changed, wherein the lattice information includes at least one of the following: three-dimensional coordinates of the lattice, reflection intensity and color information; rendering the image to be edited based on the changed lattice information to obtain a rendered image.
根据本申请实施例的另一方面,还提供了一种图像展示方法,包括:在编辑界面中展示目标图像和用于对目标图像进行编辑的至少一个编辑选项,其中,至少一个编辑选项用于对三维网格的属性进行调整;响应于对至少一个编辑选项的编辑操作,对编辑选项对应的图像属性进行配置,并保存配置结果;基于配置结果对目标图像进行重新渲染,并在编辑界面中展示重新渲染后的目标图像。According to another aspect of the embodiments of the present application, an image display method is also provided, comprising: displaying a target image and at least one editing option for editing the target image in an editing interface, wherein the at least one editing option is used for Adjust the properties of the 3D mesh; in response to an editing operation for at least one editing option, configure the image properties corresponding to the editing options, and save the configuration results; re-render the target image based on the configuration results, and display the image properties in the editing interface Displays the rerendered target image.
根据本申请实施例的另一方面,还提供了一种图像渲染装置,包括:获取模块,用于获取目标图像;计算模块,用于从目标图像中确定三维网格,并对三维网格中的点阵信息按照预设规则进行改变,其中,点阵信息包括以下至少之一:点阵的三维坐标,反射强度和颜色信息;渲染模块,用于基于改变后的点阵信息对三维网格所在的目标图像进行重新渲染,得到渲染图像。According to another aspect of the embodiments of the present application, an image rendering apparatus is further provided, including: an acquisition module for acquiring a target image; a calculation module for determining a three-dimensional grid from the target image, and for determining the three-dimensional grid The lattice information is changed according to preset rules, wherein the lattice information includes at least one of the following: three-dimensional coordinates of the lattice, reflection intensity and color information; The target image where it is located is re-rendered to obtain a rendered image.
根据本申请实施例的另一方面,还提供了一种计算机设备,包括:存储器和处理器;其中,存储器用于存储程序指令;处理器,用于执行存储于存储器中的程序指令,并在执行程序指令时,实现以下功能:获取目标图像;从目标图像中确定三维网格,并对三维网格中的点阵信息按照预设规则进行改变,其中,点阵信息包括以下至少之一:点阵的三维坐标,反射强度和颜色信息;基于改变后的点阵信息对三维网格所在的目标图像进行重新渲染,得到渲染图像。According to another aspect of the embodiments of the present application, a computer device is also provided, including: a memory and a processor; wherein the memory is used to store program instructions; the processor is used to execute the program instructions stored in the memory, and When the program instructions are executed, the following functions are implemented: acquiring a target image; determining a three-dimensional grid from the target image, and changing the lattice information in the three-dimensional grid according to preset rules, wherein the lattice information includes at least one of the following: The three-dimensional coordinates, reflection intensity and color information of the lattice; based on the changed lattice information, the target image where the three-dimensional grid is located is re-rendered to obtain a rendered image.
根据本申请实施例的另一方面,还提供了一种非易失性存储介质,其中,在程序运行时控制存储介质所在设备执行上述图像渲染方法。According to another aspect of the embodiments of the present application, a non-volatile storage medium is further provided, wherein when a program is run, a device where the storage medium is located is controlled to execute the above image rendering method.
在本申请实施例中,采用获取目标图像;从目标图像中确定三维网格,并对三维网格中的点阵信息按照预设规则进行改变,其中,点阵信息包括以下至少之一:点阵的三维坐标,反射强度和颜色信息;基于改变后的点阵信息对三维网格所在的目标图像进行重新渲染,得到渲染图像的方式,通过改变目标图像的点阵信息,达到了渲染图像的目的,从而实现了获得流动感强的渲染图像的技术效果,进而解决了现有技术无法生成符合用户需求的动态色彩渲染图的技术问题。In the embodiment of the present application, a target image is acquired; a three-dimensional grid is determined from the target image, and the lattice information in the three-dimensional grid is changed according to preset rules, wherein the lattice information includes at least one of the following: The three-dimensional coordinates, reflection intensity and color information of the matrix; based on the changed lattice information, the target image where the three-dimensional grid is located is re-rendered, and the way of rendering the image is obtained. By changing the lattice information of the target image, the rendering of the image is achieved. Therefore, the technical effect of obtaining a rendered image with a strong sense of flow is achieved, thereby solving the technical problem that the prior art cannot generate a dynamic color rendering image that meets user requirements.
附图说明Description of drawings
此处所说明的附图用来提供对本申请的进一步理解,构成本申请的一部分,本申请的示意性实施例及其说明用于解释本申请,并不构成对本申请的不当限定。在附图中:The drawings described herein are used to provide further understanding of the present application and constitute a part of the present application. The schematic embodiments and descriptions of the present application are used to explain the present application and do not constitute an improper limitation of the present application. In the attached image:
图1是根据本申请实施例的一种计算机终端的硬件结构框图;1 is a block diagram of a hardware structure of a computer terminal according to an embodiment of the present application;
图2是根据本申请实施例的一种图像渲染方法的流程示意图;2 is a schematic flowchart of an image rendering method according to an embodiment of the present application;
图3是根据本申请实施例的另一种图像渲染方法的流程示意图;3 is a schematic flowchart of another image rendering method according to an embodiment of the present application;
图4是根据本申请实施例的一种用户交互界面的界面示意图;4 is a schematic interface diagram of a user interaction interface according to an embodiment of the present application;
图5是根据本申请实施例的一种图像渲染装置的结构示意图;5 is a schematic structural diagram of an image rendering apparatus according to an embodiment of the present application;
图6是根据本申请实施例的一种图像展示方法的流程示意图。FIG. 6 is a schematic flowchart of an image display method according to an embodiment of the present application.
具体实施方式Detailed ways
为了使本技术领域的人员更好地理解本申请方案,下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本申请一部分的实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都应当属于本申请保护的范围。In order to make those skilled in the art better understand the solutions of the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only The embodiments are part of the present application, but not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative work shall fall within the scope of protection of the present application.
需要说明的是,本申请的说明书和权利要求书及上述附图中的术语“第一”、“第二”等是用于区别类似的对象,而不必用于描述特定的顺序或先后次序。应该理解这样使用的数据在适当情况下可以互换,以便这里描述的本申请的实施例能够以除了在这里图示或描述的那些以外的顺序实施。此外,术语“包括”和“具有”以及他们的任何变形,意图在于覆盖不排他的包含,例如,包含了一系列步骤或单元的过程、方法、系统、产品或设备不必限于清楚地列出的那些步骤或单元,而是可包括没有清楚地列出的或对于这些过程、方法、产品或设备固有的其它步骤或单元。It should be noted that the terms "first", "second", etc. in the description and claims of the present application and the above drawings are used to distinguish similar objects, and are not necessarily used to describe a specific sequence or sequence. It is to be understood that data so used may be interchanged under appropriate circumstances so that the embodiments of the application described herein can be practiced in sequences other than those illustrated or described herein. Furthermore, the terms "comprising" and "having" and any variations thereof, are intended to cover non-exclusive inclusion, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those expressly listed Rather, those steps or units may include other steps or units not expressly listed or inherent to these processes, methods, products or devices.
首先,在对本申请实施例进行描述的过程中出现的部分名词或术语适用于如下解释:First of all, some nouns or terms that appear in the process of describing the embodiments of the present application are suitable for the following explanations:
Shader(图形着色器语言):一种计算机程序,原本用于进行图像的浓淡处理(计算图像中的光照、亮度、颜色等),也可以被用于完成处理CG特效、进行与浓淡处理无关的影片后期处理、甚至用于一些与计算机图形学无关的其它领域。使用Shader在图形硬件上计算渲染效果有很高的自由度,大多数Shader是针对GPU开发的。GPU的可编程绘图管线已经全面取代传统的固定管线,可以使用Shader语言对其编程。Shader (graphics shader language): a computer program that was originally used for image shading processing (calculating the lighting, brightness, color, etc. in the image), and can also be used to complete the processing of CG special effects and perform shade-independent processing. Film post-processing, and even used in some other fields unrelated to computer graphics. There is a high degree of freedom in using Shaders to calculate rendering effects on graphics hardware, and most Shaders are developed for GPUs. The GPU's programmable graphics pipeline has completely replaced the traditional fixed pipeline and can be programmed using the Shader language.
GDS:全称Generative Design Studios,它是一个WebGL图形技术基础能力,是一个JS代码库(gds.js),它用算法思维去做设计,通过参数、配置接口化去反应设计、逻辑、功能之间的响应关系,对WebGL(3D绘图协议)图形开发做中台能力支撑,其包含大量的JavaScript代码与Shader代码。GDS: The full name is Generative Design Studios. It is a basic capability of WebGL graphics technology. It is a JS code library (gds.js). It uses algorithmic thinking to design, and uses parameters and configuration interfaces to reflect the relationship between design, logic, and functions. The response relationship is to support WebGL (3D drawing protocol) graphics development, which includes a large amount of JavaScript code and Shader code.
HSL:是一种将RGB色彩模型中的点在圆柱坐标系中的表示法。这两种表示法比基于笛卡尔坐标系的几何结构RGB更加直观。HSL即色相Hue、饱和度Saturation、亮度Lightness。HSL: is a representation of points in the RGB color model in a cylindrical coordinate system. These two representations are more intuitive than the Cartesian coordinate system based geometry RGB. HSL is Hue, Saturation, and Lightness.
随机噪点:随机噪点是一种由时间上随机产生的大量起伏的骚扰积累,其值在给定瞬间内不能预测。Random noise: Random noise is a temporally random accumulation of a large number of fluctuations in disturbances, the value of which is unpredictable at a given instant.
三维网格:由物体的众多点阵组成的,通过点阵形成三维模型网格。点阵包括三维坐标(xyz)、反射强度(Intensity)和颜色信息(rgb),最终绘制成网格。网格通常由三角形、四边形或者其它凸多边形组成。也就是说网格是由多边形集合定义的,用以表示三维模型表面轮廓的拓扑和空间结构。3D grid: It is composed of many lattices of objects, and a 3D model grid is formed through lattices. The lattice includes three-dimensional coordinates (xyz), reflection intensity (Intensity) and color information (rgb), and is finally drawn into a grid. Meshes usually consist of triangles, quadrilaterals, or other convex polygons. That is to say, the mesh is defined by a collection of polygons to represent the topological and spatial structure of the surface contours of the 3D model.
点阵:又称为点阵图,是由一定数目的像素组合而成的图形,也称为“图像”、“光栅图”。像素是构成点阵图的最小单位,点阵图的大小与精致程度,取决于组成点阵图的像素数目的多少。由于像素的分布是沿水平和垂直两个方向矩阵式排列的,所以任何一个点阵图总是有一定数目的水平像素和垂直像素。通常用“水平像素数×垂直像素数”表示一幅点阵图的大小。Lattice: Also known as a bitmap, it is a graphic composed of a certain number of pixels, also known as "image", "raster image". Pixel is the smallest unit that constitutes a bitmap. The size and refinement of the bitmap depends on the number of pixels that make up the bitmap. Since the distribution of pixels is arranged in a matrix along the horizontal and vertical directions, any bitmap always has a certain number of horizontal and vertical pixels. Usually "the number of horizontal pixels × the number of vertical pixels" represents the size of a bitmap.
随机噪声算法:是计算机图形学中的一类随机算法,经常用来模拟自然界中的各种纹理材质,如云、山脉等。Random noise algorithm: It is a kind of random algorithm in computer graphics, which is often used to simulate various texture materials in nature, such as clouds and mountains.
实施例1Example 1
根据本申请实施例,还提供了一种图像渲染的方法实施例,需要说明的是,在附图的流程图示出的步骤可以在诸如一组计算机可执行指令的计算机系统中执行,并且,虽然在流程图中示出了逻辑顺序,但是在某些情况下,可以以不同于此处的顺序执行所示出或描述的步骤。According to an embodiment of the present application, an image rendering method embodiment is also provided. It should be noted that the steps shown in the flowchart of the accompanying drawings may be executed in a computer system such as a set of computer-executable instructions, and, Although a logical order is shown in the flowcharts, in some cases steps shown or described may be performed in an order different from that herein.
本申请实施例一所提供的方法实施例可以在移动终端、计算机终端或者类似的运算装置中执行。图1示出了一种用于实现图像渲染方法的计算机终端(或移动设备)的硬件结构框图。如图1所示,计算机终端10可以包括一个或多个处理器102(处理器102可以包括但不限于微处理器MCU或可编程逻辑器件FPGA等的处理装置)、用于存储数据的存储器104、以及用于通信功能的传输模块106。除此以外,还可以包括:显示器、输入/输出接口(I/O接口)、通用串行总线(USB)端口(可以作为I/O接口的端口中的一个端口被包括)、网络接口、电源和/或相机。本领域普通技术人员可以理解,图1所示的结构仅为示意,其并不对上述电子装置的结构造成限定。例如,计算机终端10还可包括比图1中所示更多或者更少的组件,或者具有与图1所示不同的配置。The method embodiment provided in
应当注意到的是上述一个或多个处理器102和/或其他数据处理电路在本文中通常可以被称为“数据处理电路”。该数据处理电路可以全部或部分的体现为软件、硬件、固件或其他任意组合。此外,数据处理电路可为单个独立的处理模块,或全部或部分的结合到计算机终端10(或移动设备)中的其他元件中的任意一个内。如本申请实施例中所涉及到的,该数据处理电路作为一种处理器控制(例如与接口连接的可变电阻终端路径的选择)。It should be noted that the one or more processors 102 and/or other data processing circuits described above may generally be referred to herein as "data processing circuits." The data processing circuit may be embodied in whole or in part as software, hardware, firmware or any other combination. Furthermore, the data processing circuitry may be a single stand-alone processing module, or incorporated in whole or in part into any of the other elements in the computer terminal 10 (or mobile device). As referred to in the embodiments of the present application, the data processing circuit acts as a kind of processor control (eg, selection of a variable resistance termination path connected to an interface).
存储器104可用于存储应用软件的软件程序以及模块,如本申请实施例中的图像渲染方法对应的程序指令/数据存储装置,处理器102通过运行存储在存储器104内的软件程序以及模块,从而执行各种功能应用以及数据处理,即实现上述的应用程序的图像渲染方法。存储器104可包括高速随机存储器,还可包括非易失性存储器,如一个或者多个磁性存储装置、闪存、或者其他非易失性固态存储器。在一些实例中,存储器104可进一步包括相对于处理器102远程设置的存储器,这些远程存储器可以通过网络连接至计算机终端10。上述网络的实例包括但不限于互联网、企业内部网、局域网、移动通信网及其组合。The
传输模块106用于经由一个网络接收或者发送数据。上述的网络具体实例可包括计算机终端10的通信供应商提供的无线网络。在一个实例中,传输装置106包括一个网络适配器(Network Interface Controller,NIC),其可通过基站与其他网络设备相连从而可与互联网进行通讯。在一个实例中,传输装置106可以为射频(Radio Frequency,RF)模块,其用于通过无线方式与互联网进行通讯。The
显示器可以例如触摸屏式的液晶显示器(LCD),该液晶显示器可使得用户能够与计算机终端10的用户界面进行交互。The display may be, for example, a touch screen type liquid crystal display (LCD) that enables a user to interact with the user interface of the computer terminal 10 .
此处需要说明的是,在一些实施例中,上述图1所示的计算机设备(或移动设备)具有触摸显示器(也被称为“触摸屏”或“触摸显示屏”)。在一些实施例中,上述图1所示的计算机设备(或移动设备)具有图像用户界面(GUI),用户可以通过触摸触敏表面上的手指接触和/或手势来与GUI进行人机交互,此处的人机交互功能可选的包括如下交互:创建网页、绘图、文字处理、制作电子文档、游戏、视频会议、即时通信、收发电子邮件、通话界面、播放数字视频、播放数字音乐和/或网络浏览等、用于执行上述人机交互功能的可执行指令被配置/存储在一个或多个处理器可执行的计算机程序产品或可读存储介质中。It should be noted here that, in some embodiments, the computer device (or mobile device) shown in FIG. 1 above has a touch display (also referred to as a "touch screen" or "touch display"). In some embodiments, the computer device (or mobile device) shown in FIG. 1 above has a graphical user interface (GUI) with which the user can perform human interaction by touching finger contacts and/or gestures on the touch-sensitive surface, The human-computer interaction functions here can optionally include the following interactions: creating web pages, drawing, word processing, making electronic documents, games, video conferencing, instant messaging, sending and receiving emails, calling interfaces, playing digital video, playing digital music and/or Executable instructions for performing the above-mentioned human-computer interaction functions, such as web browsing, etc., are configured/stored in a computer program product executable by one or more processors or a readable storage medium.
图2是根据本申请实施例的图像渲染方法,如图2所示,该方法包括如下步骤:FIG. 2 is an image rendering method according to an embodiment of the present application. As shown in FIG. 2 , the method includes the following steps:
S202,获取目标图像;S202, acquiring a target image;
所述目标图像可以是存储在本地的任意图片,也可以是存储在云端的任意图片。所述任意图片可以被本地的应用程序获取并执行后续步骤。The target image may be any image stored locally, or may be any image stored in the cloud. The arbitrary picture can be acquired by the local application and the subsequent steps can be performed.
在本申请的一些实施例中,也可以将所述任意图片从客户端上传到服务器中,由服务器来执行后续的步骤。In some embodiments of the present application, the arbitrary picture may also be uploaded from the client to the server, and the server performs the subsequent steps.
S204,从所述目标图像中确定三维网格,并对所述三维网格中的点阵信息按照预设规则进行改变,其中,所述点阵信息包括以下至少之一:所述点阵的三维坐标,反射强度和颜色信息;S204, determine a three-dimensional grid from the target image, and change the lattice information in the three-dimensional grid according to a preset rule, wherein the lattice information includes at least one of the following: 3D coordinates, reflection intensity and color information;
在本申请的一些实施例中,从所述目标图像中确定三维网格,是通过以下步骤来实现的:确定所述目标三维网格对应的时间间隔;每隔所述时间间隔从所述目标图像中选择至少一个目标三维网格,其中,不同的时间间隔所选中的至少一个目标三维网格中部分相同或全部不相同。In some embodiments of the present application, determining a three-dimensional grid from the target image is achieved through the following steps: determining a time interval corresponding to the target three-dimensional grid; At least one target three-dimensional grid is selected in the image, wherein some or all of the at least one target three-dimensional grid selected at different time intervals are the same or different.
另外,在对所述三维网格中的点阵信息按照预设规则进行改变之前,还可以执行以下步骤:在从所述目标图像中选择的至少一个目标三维网格中存在相同的三维网格时,在不同时间间隔,选取所述相同的三维网格中的至少部分点阵信息,其中,所述至少部分点阵信息不完全相同。也就是说,在整个渲染并展示动态图像的过程中,为了避免单调,增加多样性,当所述目标图像中的某一块区域在一个变化周期内多次被选中时,每次选择的点阵不完全相同,这样渲染的效果也会有较大的差异。In addition, before changing the lattice information in the three-dimensional grid according to a preset rule, the following steps may be performed: the same three-dimensional grid exists in at least one target three-dimensional grid selected from the target image At different time intervals, at least part of the lattice information in the same three-dimensional grid is selected, wherein the at least part of the lattice information is not identical. That is to say, in the whole process of rendering and displaying dynamic images, in order to avoid monotony and increase diversity, when a certain area in the target image is selected multiple times within a change cycle, the selected dot matrix Not exactly the same, so the rendering effect will be quite different.
在本申请的一些实施例中,在确定每个时刻具体选择的是目标图像中哪一部分对应的三维网格时,可以是按照预设的选取规则来进行选取。其中,所述选取规则可以有多种,且不同的选取规格会产生不同的动态视觉效果,以满足用户的需要。例如,当用户希望目标图像在一个变化周期内,可以实现图像从左到右依次产生动态色彩时,所述选取规则可以按照如下步骤进行:从左到右,依次确定每个时间间隔选取的像素点,其中,每个时刻所选取的像素点所对应的三维网格就是该时间间隔的目标三维网格。在变化周期确定的情况下,所述时间间隔越短,最终渲染得到的结果就会更加流畅。In some embodiments of the present application, when determining which part of the three-dimensional mesh corresponding to the target image is specifically selected at each moment, the selection may be performed according to a preset selection rule. Wherein, there may be multiple selection rules, and different selection specifications will produce different dynamic visual effects to meet the needs of users. For example, when the user wants the target image to generate dynamic colors sequentially from left to right within a changing period, the selection rule can be performed according to the following steps: from left to right, sequentially determine the pixels selected for each time interval point, wherein the three-dimensional grid corresponding to the pixel point selected at each moment is the target three-dimensional grid of the time interval. Under the condition that the change period is determined, the shorter the time interval, the smoother the final rendering result will be.
在本申请的一些实施例中,除了预设的选取规则外,还可以由用户自行设定所述选取规则。用户在设定所需的选取规则时,可以通过调整预设的某个选取规则中的一些参数,如时间间隔长短等来生成新的选取规则,也可以是全部参数均由用户自行设定。需要注意的是,当全部参数均由用户自行设定时,用户也可以选择仅设定部分参数,剩余参数可随机生成。In some embodiments of the present application, in addition to the preset selection rules, the selection rules can also be set by the user. When setting a desired selection rule, the user can generate a new selection rule by adjusting some parameters in a preset selection rule, such as the length of the time interval, or all parameters can be set by the user. It should be noted that when all parameters are set by the user, the user can also choose to set only some parameters, and the remaining parameters can be randomly generated.
在本申请的一些实施例中,除了提前设定选取规则外,还可以实现根据用户的动作信息来确定被选取的像素点,从而确定目标三维网格。例如,当用户移动鼠标时,鼠标周围一定距离内的像素点所对应的三维网格就是目标三维网格;当用户使用具有触摸屏的设备时,用户所点击的位置附近的像素点所对应的三维网格就是目标三维网格;当运行渲染程序的设备有动作采集的相应部件时,所述设备可以捕捉用户的动作信息,例如挥动手臂等,并根据捕捉的动作信息生成相应的提取指令,来确定目标三维网格。In some embodiments of the present application, in addition to setting selection rules in advance, it is also possible to determine the selected pixel points according to the user's action information, thereby determining the target three-dimensional grid. For example, when the user moves the mouse, the 3D grid corresponding to the pixels within a certain distance around the mouse is the target 3D grid; when the user uses a device with a touch screen, the 3D grid corresponding to the pixels near the position where the user clicks The grid is the target three-dimensional grid; when the device running the rendering program has the corresponding parts for motion acquisition, the device can capture the user's motion information, such as waving an arm, etc., and generate corresponding extraction instructions according to the captured motion information to Determine the target 3D mesh.
在本申请的一些实施例中,可以通过多种预设规则对所述三维网格中的点阵信息进行改变,其中,基于随机噪点算法生成目标点阵信息,基于所述目标点阵信息对所述三维网格中的点阵信息进行替换是所述多种预设规则中优选的一种规则。In some embodiments of the present application, the lattice information in the three-dimensional grid can be changed through a variety of preset rules, wherein the target lattice information is generated based on a random noise algorithm, and the target lattice information is generated based on the target lattice information. The replacement of lattice information in the three-dimensional grid is a preferred rule among the various preset rules.
上述随机噪点算法,也可以称为噪声算法,由于噪点是近似均匀分布在整个图像表面的,所以使用随机噪点算法可以使所述目标图像在被渲染后得到的渲染图像在视觉效果上更加和谐。The above random noise algorithm may also be called a noise algorithm. Since the noise is approximately uniformly distributed on the entire image surface, the use of the random noise algorithm can make the rendered image obtained after the target image is rendered more harmonious in visual effect.
在本申请的一些实施例中,可以使用value噪声生成算法来确定目标点阵。In some embodiments of the present application, a value noise generation algorithm may be used to determine the target lattice.
Value噪声是最简单的一种噪声,其主要思路是定义若干个顶点且每个顶点含有一个随机值,这些顶点会根据自己的随机值对周围坐标产生影响,越靠近顶点则越容易受该顶点影响。当需要求某个坐标的输出值时,需要将该坐标附近的各个顶点所造成的影响值进行叠加,从而得到一个总值并输出所述总值。Value noise is the simplest kind of noise. The main idea is to define several vertices and each vertex contains a random value. These vertices will affect the surrounding coordinates according to their own random values. The closer the vertex is, the more susceptible it is to the vertex. influences. When the output value of a certain coordinate needs to be obtained, the influence values caused by the vertices near the coordinate need to be superimposed to obtain a total value and output the total value.
生成value的具体步骤包括:定义一个晶格结构,每个晶格的顶点有一个伪随机值(Value)。对于二维的Value噪声来说,晶格结构就是一个平面网格(通常是正方形),三维的就是一个立体网格(通常是正方体)。输入一个点(二维的话就是二维坐标,三维就是三维坐标,n维的就是n个坐标),并找到和它相邻的所有晶格的晶格顶点(二维下有4个,三维下有8个,n维下有2n个),得到这些顶点的伪随机值。使用缓和曲线(ease curves)来计算这些伪随机值的权重和,所述权重和就是最终得到的value噪声。The specific steps of generating the value include: defining a lattice structure, and the vertex of each lattice has a pseudo-random value (Value). For two-dimensional Value noise, the lattice structure is a flat grid (usually a square), and for three-dimensional it is a solid grid (usually a cube). Enter a point (two-dimensional coordinates are two-dimensional coordinates, three-dimensional coordinates are three-dimensional coordinates, and n-dimensional ones are n coordinates), and find the lattice vertices of all lattices adjacent to it (4 in two-dimensional, three-dimensional in There are 8, and there are 2n in n dimensions), and get pseudo-random values for these vertices. Ease curves are used to calculate the weighted sum of these pseudo-random values, which is the resulting value noise.
在本申请的一些实施例中,可以使用Perlin噪声生成算法来确定目标点阵。In some embodiments of the present application, a Perlin noise generation algorithm may be used to determine the target lattice.
Perlin噪声的生成思路是定义若干个顶点且每个顶点含有一个随机梯度向量,这些顶点会根据自己的梯度向量对周围坐标产生势能影响,沿着顶点的梯度方向越上升则势能越高。当需要求某个坐标的输出值时,需要将该坐标附近的各个顶点所造成的势能进行叠加,从而得到一个总势能并输出所述总势能。The idea of generating Perlin noise is to define several vertices and each vertex contains a random gradient vector. These vertices will have potential energy effects on the surrounding coordinates according to their own gradient vectors. The higher the gradient direction of the vertices, the higher the potential energy. When the output value of a certain coordinate needs to be obtained, the potential energy caused by each vertex near the coordinate needs to be superimposed, so as to obtain a total potential energy and output the total potential energy.
生成Perlin噪声的具体步骤包括:1.首先定义一个晶格结构,每个晶格的顶点有一个随机的梯度向量。对于二维的Perlin噪声来说,晶格结构就是一个平面网格(通常是正方形),三维的就是一个立体网格(通常是正方体)。输入一个点坐标(二维的话就是二维坐标,三维就是三维坐标,n维的就是n维坐标),找到和它相邻的全部晶格顶点(二维下有4个,三维下有8个,n维下有2n2n个),计算该点到各个晶格顶点的距离向量,再分别与顶点上的梯度向量做点乘,得到2n2n个点乘结果。使用缓和曲线来计算全部点乘结果的权重和,所述权重结果就是最终得到的Perlin噪声。The specific steps for generating Perlin noise include: 1. First, define a lattice structure, and each lattice vertex has a random gradient vector. For two-dimensional Perlin noise, the lattice structure is a planar grid (usually a square), and for three-dimensional it is a solid grid (usually a cube). Enter a point coordinate (two-dimensional coordinates are two-dimensional coordinates, three-dimensional coordinates are three-dimensional coordinates, and n-dimensional coordinates are n-dimensional coordinates), and find all lattice vertices adjacent to it (4 in 2D and 8 in 3D) , there are 2n 2n in n dimension), calculate the distance vector from this point to each lattice vertex, and then do point multiplication with the gradient vector on the vertex respectively to obtain 2n 2n point multiplication results. Use the relaxation curve to calculate the weighted sum of all dot product results, which is the final Perlin noise.
和value噪声相比,Perlin噪声的优势在于势能是沿着梯度方向渐变的,实际上是噪声函数的多次叠加,每次选取更大的频率和更小的振幅(和正弦波中的定义类似)以达成平缓变化的效果。Compared with value noise, the advantage of Perlin noise is that the potential energy is gradually changing along the gradient direction, which is actually a multiple superposition of noise functions, each time selecting a larger frequency and a smaller amplitude (similar to the definition in the sine wave). ) to achieve a smooth change effect.
基于Perlin噪声,可以实现多种图像渲染效果。最简单的应用是“溶解”,原理基于生成的柏林噪声图的对应像素点的灰度色,小于某个规定值后便舍弃该像素。规定值由一个较小的值随时间增加到一个较大的值,达成一张图片全部或部分溶解的效果。灰度值在规定值附近时使其透明度降低,达到更平滑的效果。Based on Perlin noise, a variety of image rendering effects can be achieved. The simplest application is "dissolving". The principle is based on the grayscale color of the corresponding pixel of the generated Perlin noise map, and the pixel is discarded when it is less than a certain value. The specified value increases from a small value to a large value over time to achieve the effect of dissolving a picture in whole or in part. When the gray value is near the specified value, its transparency will be reduced to achieve a smoother effect.
在本申请的一些实施例中,还可以使用Simple噪声生成算法来确定目标点阵。In some embodiments of the present application, the simple noise generation algorithm may also be used to determine the target lattice.
Simplex噪声也是一种基于晶格的梯度噪声,它和Perlin噪声在实现上唯一不同的地方在于,它的晶格并不是方形(在2D下是正方形,在3D下是立方体,在更高纬度上我们称它们为超立方体,hypercube),而是单形(simplex)。Simplex noise is also a lattice-based gradient noise. The only difference between it and Perlin noise in implementation is that its lattice is not square (square in 2D, cube in 3D, and in higher latitudes). We call them hypercubes, but simplexes.
通俗解释单形的话,可以认为是在N维空间里,选出一个最简单最紧凑的多边形,让它可以平铺整个N维空间。可以理解的,一维空间下的单形是等长的线段,把这些线段收尾相连即可铺满整个一维空间。在二维空间下,单形是三角形,可以把等腰三角形连接起来铺满整个平面。三维空间下的单形就是四面体。更高维空间的单形也是存在的。To explain the simplex in layman's terms, it can be considered as selecting the simplest and most compact polygon in the N-dimensional space, so that it can tile the entire N-dimensional space. It is understandable that a simplex in a one-dimensional space is a line segment of equal length, and the entire one-dimensional space can be covered by connecting these line segments at the end. In two-dimensional space, a simplex is a triangle, and isosceles triangles can be connected to cover the entire plane. A simplex in three-dimensional space is a tetrahedron. Simplexes of higher dimensional spaces also exist.
S206,基于改变后的点阵信息对所述三维网格所在的目标图像进行重新渲染,得到渲染图像。S206, re-rendering the target image where the three-dimensional grid is located based on the changed lattice information to obtain a rendered image.
在本申请的一些实施例中,在基于改变后的点阵信息对所述三维网格所在的目标图像进行重新渲染时,还可以基于图1中所述的计算机终端(或移动设备)响应来自用户的操作指令,以实现对图像的个性化渲染,使得渲染结果更符合用户的期望。其中所述操作指令具体可以通过以下方式生成:在编辑界面中展示所述目标图像和用于对所述目标图像进行编辑的至少一个编辑选项,其中,所述至少一个编辑选项用于对所述三维网格的属性进行调整。所述编辑选项允许用户对编辑选项进行对应的编辑操作,也就是允许用户自行更改一些渲染参数,使得最后的渲染结果更加个性化,更符合用户的期望。计算机终端(或移动设备)可以响应于对至少一个所述编辑选项的编辑操作,对所述编辑选项对应的图像属性进行配置,并保存配置结果,然后基于所述配置结果对所述目标图像进行渲染。所述图像属性包括点阵的坐标扭曲程度,辅色相对于主色的变化程度等。In some embodiments of the present application, when the target image where the three-dimensional grid is located is re-rendered based on the changed lattice information, the computer terminal (or mobile device) described in FIG. 1 may also respond to the The user's operation instruction is used to realize the personalized rendering of the image, so that the rendering result is more in line with the user's expectation. Specifically, the operation instruction may be generated by: displaying the target image and at least one editing option for editing the target image in an editing interface, wherein the at least one editing option is used for editing the target image. The properties of the 3D mesh can be adjusted. The editing option allows the user to perform corresponding editing operations on the editing option, that is, allows the user to change some rendering parameters by himself, so that the final rendering result is more personalized and more in line with the user's expectation. The computer terminal (or mobile device) may, in response to an editing operation on at least one of the editing options, configure the image attribute corresponding to the editing option, save the configuration result, and then perform an operation on the target image based on the configuration result. render. The image attributes include the degree of coordinate distortion of the dot matrix, the degree of change of the secondary color relative to the main color, and the like.
具体地,所述至少一个编辑选项包括:对所述点阵信息进行配置的选项;对所述三维网格的扭曲参数进行配置的选项、对相邻两次对所述三维网格的点阵信息进行变换的时间间隔进行配置的选项。所述对相邻两次所述三维网格的点阵信息进行变换的时间间隔进行配置的选项,可以通过对时间间隔的调整使得最终渲染结果更符合用户的需求。例如,当用户希望渲染后的图像在展示动态色彩时可以更加流畅一些时,可以将所述时间间隔设置地短一些;当用户不希望渲染程序占用太多计算资源时,可以将所述时间间隔设置地短一些。所述扭曲参数包括扭曲高度,扭曲波幅,整体扭曲强度等。通过对所述扭曲参数的调整,可以改变目标图像在每个时刻动态色彩部分的面积相对于原图像的面积的比例。Specifically, the at least one editing option includes: an option for configuring the lattice information; an option for configuring a distortion parameter of the three-dimensional grid, an option for configuring the lattice of the three-dimensional grid twice adjacently Option to configure the time interval at which information is transformed. The option of configuring the time interval for transforming the lattice information of the three-dimensional grid two times adjacently may make the final rendering result more in line with the user's needs by adjusting the time interval. For example, when the user wants the rendered image to be more fluent in displaying dynamic colors, the time interval can be set to be shorter; when the user does not want the rendering program to occupy too much computing resources, the time interval can be set to a shorter time. Set to be shorter. The twist parameters include twist height, twist amplitude, overall twist strength, and the like. By adjusting the distortion parameters, the ratio of the area of the dynamic color portion of the target image to the area of the original image at each moment can be changed.
图4是根据本申请实施例的一种为用户提供了多种编辑选项的交互界面。如图4所示,图中右半部分的“色彩搭配”部分的编辑按钮可以由用户自主搭配与主色对应的辅色;“背景颜色”部分的编辑按钮可以让用户选择想要的目标图像的颜色;“色彩偏移”和“动态参数”可以让用户对渲染的动态区域大小等进行调节;“预设”部分的编辑按钮可以让用户直接选择预先设定好的动态效果;“随机功能”部分的编辑按钮可以让用户选择全部渲染参数均随机或部分参数随机,以得到更符合用户意愿的渲染结果。左半部分的图像展示区域,可以展示原图像,以及相应参数修改后的渲染效果,方便用户得到想要的渲染结果。FIG. 4 is an interactive interface that provides a user with multiple editing options according to an embodiment of the present application. As shown in Figure 4, the edit button in the "Color Matching" part of the right half of the figure can be independently matched by the user with the secondary color corresponding to the main color; the edit button in the "Background Color" part allows the user to select the desired target image "Color Offset" and "Dynamic Parameters" allow users to adjust the size of the dynamic area of the rendering; the edit button in the "Preset" section allows users to directly select the preset dynamic effects; "Random function" ” part of the edit button allows the user to select all rendering parameters to be random or part of the parameters to be random, so as to obtain a rendering result that is more in line with the user's wishes. The image display area in the left half can display the original image and the rendering effect after modification of the corresponding parameters, so that the user can obtain the desired rendering result.
在本申请的一些实施例中,基于改变后的点阵信息对所述三维网格所在的目标图像进行重新渲染,得到渲染图像,具体是通过以下步骤来进行渲染的:确定所述改变后的点阵信息所对应的主色,并依据预设策略在所述主色的周围生成与所述主色搭配的辅色的属性信息,其中,所述属性信息包括以下至少之一:辅色的色相值、饱和度和亮度。In some embodiments of the present application, the target image where the three-dimensional grid is located is re-rendered based on the changed lattice information to obtain a rendered image. Specifically, the rendering is performed by the following steps: determining the changed The main color corresponding to the dot matrix information, and the attribute information of the auxiliary color matched with the main color is generated around the main color according to the preset strategy, wherein the attribute information includes at least one of the following: Hue value, saturation and lightness.
为了实现主色与辅色的协调搭配,所述辅色的属性信息所对应的属性值与所述主色的属性信息所对应的属性值之间的差异小于预设阈值。其中,所述预设阈值可以由用户来自行调节。当用户希望目标图像经过渲染后得到的动态图像,各个色块之间的色彩过渡更加柔和协调一些时,可以将所述阈值设置为一个较小的值;当用户希望目标图像经过渲染后得到的动态图像,各个色块之间的对比更加强烈一些时,可以将所述阈值设置为一个较大的值。In order to realize the coordinated collocation of the main color and the auxiliary color, the difference between the attribute value corresponding to the attribute information of the auxiliary color and the attribute value corresponding to the attribute information of the main color is smaller than a preset threshold. Wherein, the preset threshold can be adjusted by the user. When the user wants the dynamic image obtained after the target image is rendered, the color transition between the color blocks is softer and more harmonious, the threshold can be set to a smaller value; when the user wants the target image to be rendered after rendering In a dynamic image, when the contrast between each color block is stronger, the threshold can be set to a larger value.
另外,图1所述的计算机装置(或终端设备)还可以为用户提供一个如图4所示的操作界面,并执行用户在所述操作界面上的相应操作所发出的指令。所述操作界面可以让用户可自行确定所述辅色的色相值,饱和度和亮度相对于所述主色的变化量。In addition, the computer device (or terminal device) shown in FIG. 1 can also provide the user with an operation interface as shown in FIG. 4 , and execute instructions issued by the user through corresponding operations on the operation interface. The operation interface allows the user to determine the hue value of the secondary color, the variation of saturation and brightness relative to the primary color.
需要说明的是,对于前述的各方法实施例,为了简单描述,故将其都表述为一系列的动作组合,但是本领域技术人员应该知悉,本申请并不受所描述的动作顺序的限制,因为依据本申请,某些步骤可以采用其他顺序或者同时进行。其次,本领域技术人员也应该知悉,说明书中所描述的实施例均属于优选实施例,所涉及的动作和模块并不一定是本申请所必须的。It should be noted that, for the sake of simple description, the foregoing method embodiments are all expressed as a series of action combinations, but those skilled in the art should know that the present application is not limited by the described action sequence. Because in accordance with the present application, certain steps may be performed in other orders or concurrently. Secondly, those skilled in the art should also know that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present application.
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到根据上述实施例的方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质(如ROM/RAM、磁碟、光盘)中,包括若干指令用以使得一台终端设备(可以是手机,计算机,服务器,或者网络设备等)执行本申请各个实施例所述的方法。From the description of the above embodiments, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course can also be implemented by hardware, but in many cases the former is better implementation. Based on this understanding, the technical solution of the present application can be embodied in the form of a software product in essence or in a part that contributes to the prior art, and the computer software product is stored in a storage medium (such as ROM/RAM, magnetic disk, CD-ROM), including several instructions to make a terminal device (which may be a mobile phone, a computer, a server, or a network device, etc.) execute the methods described in the various embodiments of this application.
实施例2Example 2
图3是根据本申请实施例的另一种图像渲染方法,如图3所示,该方法包括如下步骤:FIG. 3 is another image rendering method according to an embodiment of the present application. As shown in FIG. 3 , the method includes the following steps:
S302,在编辑界面中展示接收的待编辑图像;S302, displaying the received image to be edited in the editing interface;
所述编辑界面如图4所示,图中右半部分的“色彩搭配”部分的编辑按钮可以由用户自主搭配与主色对应的辅色;“背景颜色”部分的编辑按钮可以让用户选择想要的目标图像的颜色;“色彩偏移”和“动态参数”可以让用户对渲染的动态区域大小等进行调节;“预设”部分的编辑按钮可以让用户直接选择预先设定好的动态效果;“随机功能”部分的编辑按钮可以让用户选择全部渲染参数均随机或部分参数随机,以得到更符合用户意愿的渲染结果。左半部分的图像展示区域,可以展示原图像,以及相应参数修改后的渲染效果,方便用户得到想要的渲染结果。The editing interface is shown in Figure 4. The editing buttons in the "color matching" part of the right half of the figure can be independently matched by the user with the secondary colors corresponding to the main colors; the editing buttons in the "background color" part allow the user to choose the desired color. The color of the desired target image; "Color Offset" and "Dynamic Parameters" allow users to adjust the size of the dynamic area of the rendering; the edit button in the "Preset" section allows users to directly select the preset dynamic effects ; The edit button in the "Random Function" section allows the user to select all rendering parameters to be random or part of the parameters to be random, so as to obtain a rendering result that is more in line with the user's wishes. The image display area in the left half can display the original image and the rendering effect after modification of the corresponding parameters, so that the user can obtain the desired rendering result.
所述待编辑图像可以是存储在本地的任意图片,也可以是存储在云端的任意图片。所述任意图片可以被本地的应用程序获取并执行后续步骤。The to-be-edited image may be any image stored locally, or may be any image stored in the cloud. The arbitrary picture can be acquired by the local application and the subsequent steps can be performed.
在本申请的一些实施例中,也可以将所述任意图片从客户端上传到服务器中,由服务器来执行后续的步骤。In some embodiments of the present application, the arbitrary picture may also be uploaded from the client to the server, and the server performs the subsequent steps.
S304,以所述待编辑图像中的三维网格为单位,对所述待编辑图像中的点阵信息进行改变,其中,所述点阵信息包括以下至少之一:所述点阵的三维坐标,反射强度和颜色信息;S304, using the three-dimensional grid in the image to be edited as a unit, change the lattice information in the image to be edited, wherein the lattice information includes at least one of the following: the three-dimensional coordinates of the lattice , reflection intensity and color information;
在本申请的一些实施例中,在对点阵信息进行改变前,需要先从所述待编辑图像中确定三维网格。从所述目标图像中确定三维网格,是通过以下步骤来实现的:确定所述目标三维网格对应的时间间隔;每隔所述时间间隔从所述目标图像中选择至少一个目标三维网格,其中,不同的时间间隔所选中的至少一个目标三维网格中部分相同或全部不相同。In some embodiments of the present application, before changing the lattice information, a three-dimensional grid needs to be determined from the image to be edited. Determining a three-dimensional grid from the target image is achieved through the following steps: determining a time interval corresponding to the target three-dimensional grid; selecting at least one target three-dimensional grid from the target image every time interval , wherein some or all of the at least one target three-dimensional grid selected at different time intervals are the same or different.
另外,在对所述三维网格中的点阵信息按照预设规则进行改变之前,还可以执行以下步骤:在从所述目标图像中选择的至少一个目标三维网格中存在相同的三维网格时,在不同时间间隔,选取所述相同的三维网格中的至少部分点阵信息,其中,所述至少部分点阵信息不完全相同。也就是说,在整个渲染并展示动态图像的过程中,为了避免单调,增加多样性,当所述目标图像中的某一块区域在一个变化周期内多次被选中时,每次选择的点阵不完全相同,这样渲染的效果也会有较大的差异。In addition, before changing the lattice information in the three-dimensional grid according to a preset rule, the following steps may be performed: the same three-dimensional grid exists in at least one target three-dimensional grid selected from the target image At different time intervals, at least part of the lattice information in the same three-dimensional grid is selected, wherein the at least part of the lattice information is not identical. That is to say, in the whole process of rendering and displaying dynamic images, in order to avoid monotony and increase diversity, when a certain area in the target image is selected multiple times within a change cycle, the selected dot matrix Not exactly the same, so the rendering effect will be quite different.
在本申请的一些实施例中,在确定每个时刻具体选择的是目标图像中哪一部分对应的三维网格时,可以是按照预设的选取规则来进行选取。其中,所述选取规则可以有多种,且不同的选取规格会产生不同的动态视觉效果,以满足用户的需要。例如,当用户希望目标图像在一个变化周期内,可以实现图像从左到右依次产生动态色彩时,所述选取规则可以按照如下步骤进行:从左到右,依次确定每个时间间隔选取的像素点,其中,每个时刻所选取的像素点所对应的三维网格就是该时间间隔的目标三维网格。在变化周期确定的情况下,所述时间间隔越短,最终渲染得到的结果就会更加流畅。In some embodiments of the present application, when determining which part of the three-dimensional mesh corresponding to the target image is specifically selected at each moment, the selection may be performed according to a preset selection rule. Wherein, there may be multiple selection rules, and different selection specifications will produce different dynamic visual effects to meet the needs of users. For example, when the user wants the target image to generate dynamic colors sequentially from left to right within a changing period, the selection rule can be performed according to the following steps: from left to right, sequentially determine the pixels selected for each time interval point, wherein the three-dimensional grid corresponding to the pixel point selected at each moment is the target three-dimensional grid of the time interval. Under the condition that the change period is determined, the shorter the time interval, the smoother the final rendering result will be.
在本申请的一些实施例中,除了预设的选取规则外,还可以由用户自行设定所述选取规则。用户在设定所需的选取规则时,可以通过调整预设的某个选取规则中的一些参数,如时间间隔长短等来生成新的选取规则,也可以是全部参数均由用户自行设定。需要注意的是,当全部参数均由用户自行设定时,用户也可以选择仅设定部分参数,剩余参数可随机生成。In some embodiments of the present application, in addition to the preset selection rules, the selection rules can also be set by the user. When setting a desired selection rule, the user can generate a new selection rule by adjusting some parameters in a preset selection rule, such as the length of the time interval, or all parameters can be set by the user. It should be noted that when all parameters are set by the user, the user can also choose to set only some parameters, and the remaining parameters can be randomly generated.
在本申请的一些实施例中,除了提前设定选取规则外,还可以实现根据用户的动作信息来确定被选取的像素点,从而确定目标三维网格。例如,当用户移动鼠标时,鼠标周围一定距离内的像素点所对应的三维网格就是目标三维网格;当用户使用具有触摸屏的设备时,用户所点击的位置附近的像素点所对应的三维网格就是目标三维网格;当运行渲染程序的设备有动作采集的相应部件时,所述设备可以捕捉用户的动作信息,例如挥动手臂等,并根据捕捉的动作信息生成相应的提取指令,来确定目标三维网格。In some embodiments of the present application, in addition to setting selection rules in advance, it is also possible to determine the selected pixel points according to the user's action information, thereby determining the target three-dimensional grid. For example, when the user moves the mouse, the 3D grid corresponding to the pixels within a certain distance around the mouse is the target 3D grid; when the user uses a device with a touch screen, the 3D grid corresponding to the pixels near the position where the user clicks The grid is the target three-dimensional grid; when the device running the rendering program has the corresponding parts for motion acquisition, the device can capture the user's motion information, such as waving an arm, etc., and generate corresponding extraction instructions according to the captured motion information to Determine the target 3D mesh.
在本申请的一些实施例中,可以通过多种预设规则对所述三维网格中的点阵信息进行改变,其中,基于随机噪点算法生成目标点阵信息,基于所述目标点阵信息对所述三维网格中的点阵信息进行替换是所述多种预设规则中优选的一种规则。In some embodiments of the present application, the lattice information in the three-dimensional grid can be changed through a variety of preset rules, wherein the target lattice information is generated based on a random noise algorithm, and the target lattice information is generated based on the target lattice information. The replacement of lattice information in the three-dimensional grid is a preferred rule among the various preset rules.
在本申请的一些实施例中,使用的随机噪点算法可以是value噪声生成算法,Perlin噪声生成算法,Simplex噪声生成算法等随机噪点算法,也可以是其他的随机噪点算法。In some embodiments of the present application, the random noise algorithm used may be a value noise generation algorithm, a Perlin noise generation algorithm, a Simplex noise generation algorithm, or other random noise algorithms, or other random noise algorithms.
S306,基于改变后的点阵信息对所述待编辑图像进行渲染,得到渲染图像。S306, rendering the image to be edited based on the changed lattice information to obtain a rendered image.
在本申请的一些实施例中,为了提高渲染速度,优化用户体验,可以使用渲染工具(例如Shader)通过显卡GPU进行并发运算,实时渲染生成高性能视效。In some embodiments of the present application, in order to improve the rendering speed and optimize the user experience, a rendering tool (such as Shader) may be used to perform concurrent operations through a graphics card GPU, and real-time rendering may be used to generate high-performance visual effects.
在本申请的一些实施例中,在基于改变后的点阵信息对所述三维网格所在的目标图像进行重新渲染时,还可以基于图1中所述的计算机终端(或移动设备)响应来自用户的操作指令,以实现对图像的个性化渲染,使得渲染结果更符合用户的期望。其中所述操作指令具体可以通过以下方式生成:在编辑界面中展示所述目标图像和用于对所述目标图像进行编辑的至少一个编辑选项,其中所述至少一个编辑选项用于对所述三维网格的属性进行调整。所述编辑选项允许用户对编辑选项进行对应的编辑操作,也就是允许用户自行更改一些渲染参数,使得最后的渲染结果更加个性化,更符合用户的期望。计算机终端(或移动设备)可以响应于对至少一个所述编辑选项的编辑操作,对所述编辑选项对应的图像属性进行配置,并保存配置结果,然后基于所述配置结果对所述目标图像进行渲染。所述图像属性包括点阵的坐标扭曲程度,辅色相对于主色的变化程度等。In some embodiments of the present application, when the target image where the three-dimensional grid is located is re-rendered based on the changed lattice information, the computer terminal (or mobile device) described in FIG. 1 may also respond to the The user's operation instruction is used to realize the personalized rendering of the image, so that the rendering result is more in line with the user's expectation. Specifically, the operation instruction may be generated by: displaying the target image and at least one editing option for editing the target image in an editing interface, wherein the at least one editing option is used for editing the three-dimensional The properties of the grid can be adjusted. The editing option allows the user to perform corresponding editing operations on the editing option, that is, allows the user to change some rendering parameters by himself, so that the final rendering result is more personalized and more in line with the user's expectation. The computer terminal (or mobile device) may, in response to an editing operation on at least one of the editing options, configure the image attribute corresponding to the editing option, save the configuration result, and then perform an operation on the target image based on the configuration result. render. The image attributes include the degree of coordinate distortion of the dot matrix, the degree of change of the secondary color relative to the main color, and the like.
具体地,所述至少一个编辑选项包括:对所述点阵信息进行配置的选项;对所述三维网格的扭曲参数进行配置的选项、对相邻两次对所述三维网格的点阵信息进行变换的时间间隔进行配置的选项。所述对相邻两次所述三维网格的点阵信息进行变换的时间间隔进行配置的选项,可以通过对时间间隔的调整使得最终渲染结果更符合用户的需求。例如,当用户希望渲染后的图像在展示动态色彩时可以更加流畅一些时,可以将所述时间间隔设置地短一些;当用户不希望渲染程序占用太多计算资源时,可以将所述时间间隔设置地短一些。所述扭曲参数包括扭曲高度,扭曲波幅,整体扭曲强度等。通过对所述扭曲参数的调整,可以改变目标图像在每个时刻动态色彩部分的面积相对于原图像的面积的比例。Specifically, the at least one editing option includes: an option for configuring the lattice information; an option for configuring a distortion parameter of the three-dimensional grid, an option for configuring the lattice of the three-dimensional grid twice adjacently Option to configure the time interval at which information is transformed. The option of configuring the time interval for transforming the lattice information of the three-dimensional grid two times adjacently may make the final rendering result more in line with the user's needs by adjusting the time interval. For example, when the user wants the rendered image to be more fluent in displaying dynamic colors, the time interval can be set to be shorter; when the user does not want the rendering program to occupy too much computing resources, the time interval can be set to a shorter time. Set to be shorter. The twist parameters include twist height, twist amplitude, overall twist strength, and the like. By adjusting the distortion parameters, the ratio of the area of the dynamic color portion of the target image to the area of the original image at each moment can be changed.
在本申请的一些实施例中,基于改变后的点阵信息对所述三维网格所在的目标图像进行重新渲染,得到渲染图像,具体是通过以下步骤来进行渲染的:确定所述改变后的点阵信息所对应的主色,并依据预设策略在所述主色的周围生成与所述主色搭配的辅色的属性信息,其中,所述属性信息包括以下至少之一:辅色的色相值、饱和度和亮度。In some embodiments of the present application, the target image where the three-dimensional grid is located is re-rendered based on the changed lattice information to obtain a rendered image. Specifically, the rendering is performed by the following steps: determining the changed The main color corresponding to the dot matrix information, and the attribute information of the auxiliary color matched with the main color is generated around the main color according to the preset strategy, wherein the attribute information includes at least one of the following: Hue value, saturation and lightness.
为了实现主色与辅色的协调搭配,所述辅色的属性信息所对应的属性值与所述主色的属性信息所对应的属性值之间的差异小于预设阈值。其中,所述预设阈值可以由用户来自行调节。当用户希望目标图像经过渲染后得到的动态图像,各个色块之间的色彩过渡更加柔和协调一些时,可以将所述阈值设置为一个较小的值;当用户希望目标图像经过渲染后得到的动态图像,各个色块之间的对比更加强烈一些时,可以将所述阈值设置为一个较大的值。In order to realize the coordinated collocation of the main color and the auxiliary color, the difference between the attribute value corresponding to the attribute information of the auxiliary color and the attribute value corresponding to the attribute information of the main color is smaller than a preset threshold. Wherein, the preset threshold can be adjusted by the user. When the user wants the dynamic image obtained after the target image is rendered, the color transition between the color blocks is softer and more harmonious, the threshold can be set to a smaller value; when the user wants the target image to be rendered after rendering In a dynamic image, when the contrast between each color block is stronger, the threshold can be set to a larger value.
另外,图1所述的计算机装置(或终端设备)还可以为用户提供一个如图4所示的操作界面,并执行用户在所述操作界面上的相应操作所发出的指令。所述操作界面可以让用户可自行确定所述辅色的色相值,饱和度和亮度相对于所述主色的变化量。In addition, the computer device (or terminal device) shown in FIG. 1 can also provide the user with an operation interface as shown in FIG. 4 , and execute instructions issued by the user through corresponding operations on the operation interface. The operation interface allows the user to determine the hue value of the secondary color, the variation of saturation and brightness relative to the primary color.
实施例3Example 3
根据本申请实施例,还提供了一种用于实施上述图像渲染方法的装置,如图5所示,该装置包括:获取模块50,用于获取目标图像;计算模块52,用于从所述目标图像中确定三维网格,并对所述三维网格中的点阵信息按照预设规则进行改变,其中,所述点阵信息包括以下至少之一:所述点阵的三维坐标,反射强度和颜色信息;渲染模块54,用于基于改变后的点阵信息对所述三维网格所在的目标图像进行重新渲染,得到渲染图像。According to an embodiment of the present application, an apparatus for implementing the above image rendering method is also provided. As shown in FIG. 5 , the apparatus includes: an acquisition module 50 for acquiring a target image; a calculation module 52 for obtaining a target image from the A three-dimensional grid is determined in the target image, and the lattice information in the three-dimensional grid is changed according to preset rules, wherein the lattice information includes at least one of the following: the three-dimensional coordinates of the lattice, the reflection intensity and color information; the rendering module 54 is configured to re-render the target image where the three-dimensional grid is located based on the changed lattice information to obtain a rendered image.
此处需要说明的是,上述获取模块50对应于实施例1中的步骤S202,上述计算模块32对应于实施例2中的步骤S504,上述渲染模块34对应于实施例3中的步骤S506。每个模块与对应的步骤所实现的实例和应用场景相同,但不限于上述实施例1所公开的内容。需要说明的是,上述模块作为装置的一部分可以运行在实施例1提供的计算机终端10中。It should be noted here that the acquisition module 50 corresponds to step S202 in
在本申请的一些实施例中,所述获取模块50可以从本地存储中提取目标图像,也可以从云端或者网络上下载图像作为目标图像。In some embodiments of the present application, the acquiring module 50 may extract the target image from the local storage, or may download the image from the cloud or the network as the target image.
在本申请的一些实施例中,所述计算模块52是通过以下步骤实现从目标图像中确定三维网格的:确定所述目标三维网格对应的时间间隔;每隔所述时间间隔从所述目标图像中选择至少一个目标三维网格,其中,不同的时间间隔所选中的至少一个目标三维网格中部分相同或全部不相同。In some embodiments of the present application, the calculation module 52 determines the three-dimensional grid from the target image through the following steps: determining a time interval corresponding to the target three-dimensional grid; At least one target three-dimensional grid is selected from the target image, wherein some or all of the at least one target three-dimensional grid selected at different time intervals are the same or different.
另外,在对所述三维网格中的点阵信息按照预设规则进行改变之前,还可以执行以下步骤:在从所述目标图像中选择的至少一个目标三维网格中存在相同的三维网格时,在不同时间间隔,选取所述相同的三维网格中的至少部分点阵信息,其中,所述至少部分点阵信息不完全相同。也就是说,在整个渲染并展示动态图像的过程中,为了避免单调,增加多样性,当所述目标图像中的某一块区域在一个变化周期内多次被选中时,每次选择的点阵不完全相同,这样渲染的效果也会有较大的差异。In addition, before changing the lattice information in the three-dimensional grid according to a preset rule, the following steps may be performed: the same three-dimensional grid exists in at least one target three-dimensional grid selected from the target image At different time intervals, at least part of the lattice information in the same three-dimensional grid is selected, wherein the at least part of the lattice information is not identical. That is to say, in the whole process of rendering and displaying dynamic images, in order to avoid monotony and increase diversity, when a certain area in the target image is selected multiple times within a change cycle, the selected dot matrix Not exactly the same, so the rendering effect will be quite different.
在本申请的一些实施例中,在确定每个时刻具体选择的是目标图像中哪一部分对应的三维网格时,可以是按照预设的选取规则来进行选取。其中,所述选取规则可以有多种,且不同的选取规格会产生不同的动态视觉效果,以满足用户的需要。例如,当用户希望目标图像在一个变化周期内,可以实现图像从左到右依次产生动态色彩时,所述选取规则可以按照如下步骤进行:从左到右,依次确定每个时间间隔选取的像素点,其中,每个时刻所选取的像素点所对应的三维网格就是该时间间隔的目标三维网格。在变化周期确定的情况下,所述时间间隔越短,最终渲染得到的结果就会更加流畅。In some embodiments of the present application, when determining which part of the three-dimensional mesh corresponding to the target image is specifically selected at each moment, the selection may be performed according to a preset selection rule. Wherein, there may be multiple selection rules, and different selection specifications will produce different dynamic visual effects to meet the needs of users. For example, when the user wants the target image to generate dynamic colors sequentially from left to right within a changing period, the selection rule can be performed according to the following steps: from left to right, sequentially determine the pixels selected for each time interval point, wherein the three-dimensional grid corresponding to the pixel point selected at each moment is the target three-dimensional grid of the time interval. Under the condition that the change period is determined, the shorter the time interval, the smoother the final rendering result will be.
在本申请的一些实施例中,除了预设的选取规则外,还可以由用户自行设定所述选取规则。用户在设定所需的选取规则时,可以通过调整预设的某个选取规则中的一些参数,如时间间隔长短等来生成新的选取规则,也可以是全部参数均由用户自行设定。需要注意的是,当全部参数均由用户自行设定时,用户也可以选择仅设定部分参数,剩余参数可随机生成。In some embodiments of the present application, in addition to the preset selection rules, the selection rules can also be set by the user. When setting a desired selection rule, the user can generate a new selection rule by adjusting some parameters in a preset selection rule, such as the length of the time interval, or all parameters can be set by the user. It should be noted that when all parameters are set by the user, the user can also choose to set only some parameters, and the remaining parameters can be randomly generated.
在本申请的一些实施例中,除了提前设定选取规则外,还可以实现根据用户的动作信息来确定被选取的像素点,从而确定目标三维网格。例如,当用户移动鼠标时,鼠标周围一定距离内的像素点所对应的三维网格就是目标三维网格;当用户使用具有触摸屏的设备时,用户所点击的位置附近的像素点所对应的三维网格就是目标三维网格;当运行渲染程序的设备有动作采集的相应部件时,所述设备可以捕捉用户的动作信息,例如挥动手臂等,并根据捕捉的动作信息生成相应的提取指令,来确定目标三维网格。In some embodiments of the present application, in addition to setting selection rules in advance, it is also possible to determine the selected pixel points according to the user's action information, thereby determining the target three-dimensional grid. For example, when the user moves the mouse, the 3D grid corresponding to the pixels within a certain distance around the mouse is the target 3D grid; when the user uses a device with a touch screen, the 3D grid corresponding to the pixels near the position where the user clicks The grid is the target three-dimensional grid; when the device running the rendering program has the corresponding parts for motion acquisition, the device can capture the user's motion information, such as waving an arm, etc., and generate corresponding extraction instructions according to the captured motion information to Determine the target 3D mesh.
在本申请的一些实施例中,可以通过多种预设规则对所述三维网格中的点阵信息进行改变,其中,基于随机噪点算法生成目标点阵信息,基于所述目标点阵信息对所述三维网格中的点阵信息进行替换是所述多种预设规则中优选的一种规则。In some embodiments of the present application, the lattice information in the three-dimensional grid can be changed through a variety of preset rules, wherein the target lattice information is generated based on a random noise algorithm, and the target lattice information is generated based on the target lattice information. The replacement of lattice information in the three-dimensional grid is a preferred rule among the various preset rules.
在本申请的一些实施例中,使用的随机噪点算法可以是value噪声生成算法,Perlin噪声生成算法,Simplex噪声生成算法等随机噪点算法,也可以是其他的随机噪点算法。In some embodiments of the present application, the random noise algorithm used may be a value noise generation algorithm, a Perlin noise generation algorithm, a Simplex noise generation algorithm, or other random noise algorithms, or other random noise algorithms.
在本申请的一些实施例中,上述渲染模块54在基于改变后的点阵信息对所述三维网格所在的目标图像进行重新渲染时,还可以基于图1中所述的计算机终端(或移动设备)响应来自用户的操作指令,以实现对图像的个性化渲染,使得渲染结果更符合用户的期望。其中所述操作指令具体可以通过以下方式生成:在编辑界面中展示所述目标图像和所述目标图像的至少一个编辑选项,所述编辑选项允许用户对编辑选项进行对应的编辑操作,也就是允许用户自行更改一些渲染参数,使得最后的渲染结果更加个性化,更符合用户的期望。计算机终端(或移动设备)可以响应于对至少一个所述编辑选项的编辑操作,对所述编辑选项对应的图像属性进行配置,并保存配置结果,然后基于所述配置结果对所述目标图像进行渲染。所述图像属性包括点阵的坐标扭曲程度,辅色相对于主色的变化程度等。In some embodiments of the present application, when the above-mentioned rendering module 54 re-renders the target image where the three-dimensional grid is located based on the changed lattice information, it may also be based on the computer terminal (or mobile device) responds to the operation instruction from the user, so as to realize the personalized rendering of the image, so that the rendering result is more in line with the user's expectation. Specifically, the operation instruction may be generated in the following manner: displaying the target image and at least one editing option of the target image in the editing interface, and the editing option allows the user to perform a corresponding editing operation on the editing option, that is, allowing the user to perform a corresponding editing operation on the editing option. Users can change some rendering parameters by themselves, so that the final rendering results are more personalized and more in line with user expectations. The computer terminal (or mobile device) may, in response to an editing operation on at least one of the editing options, configure the image attribute corresponding to the editing option, save the configuration result, and then perform an operation on the target image based on the configuration result. render. The image attributes include the degree of coordinate distortion of the dot matrix, the degree of change of the secondary color relative to the main color, and the like.
具体地,所述至少一个编辑选项包括:对所述点阵信息进行配置的选项;对所述三维网格的扭曲参数进行配置的选项、对相邻两次对所述三维网格的点阵信息进行变换的时间间隔进行配置的选项。所述对相邻两次所述三维网格的点阵信息进行变换的时间间隔进行配置的选项,可以通过对时间间隔的调整使得最终渲染结果更符合用户的需求。例如,当用户希望渲染后的图像在展示动态色彩时可以更加流畅一些时,可以将所述时间间隔设置地短一些;当用户不希望渲染程序占用太多计算资源时,可以将所述时间间隔设置地短一些。所述扭曲参数包括扭曲高度,扭曲波幅,整体扭曲强度等。通过对所述扭曲参数的调整,可以改变目标图像在每个时刻动态色彩部分的面积相对于原图像的面积的比例。Specifically, the at least one editing option includes: an option for configuring the lattice information; an option for configuring a distortion parameter of the three-dimensional grid, an option for configuring the lattice of the three-dimensional grid twice adjacently Option to configure the time interval at which information is transformed. The option of configuring the time interval for transforming the lattice information of the three-dimensional grid two times adjacently may make the final rendering result more in line with the user's needs by adjusting the time interval. For example, when the user wants the rendered image to be more fluent in displaying dynamic colors, the time interval can be set to be shorter; when the user does not want the rendering program to occupy too much computing resources, the time interval can be set to a shorter time. Set to be shorter. The twist parameters include twist height, twist amplitude, overall twist strength, and the like. By adjusting the distortion parameters, the ratio of the area of the dynamic color portion of the target image to the area of the original image at each moment can be changed.
图4是根据本申请实施例的一种为用户提供了多种编辑选项的交互界面。如图4所示,图中右半部分的“色彩搭配”部分的编辑按钮可以由用户自主搭配与主色对应的辅色;“背景颜色”部分的编辑按钮可以让用户选择想要的目标图像的颜色;“色彩偏移”和“动态参数”可以让用户对渲染的动态区域大小等进行调节;“预设”部分的编辑按钮可以让用户直接选择预先设定好的动态效果;“随机功能”部分的编辑按钮可以让用户选择全部渲染参数均随机或部分参数随机,以得到更符合用户意愿的渲染结果。左半部分的图像展示区域,可以展示原图像,以及相应参数修改后的渲染效果,方便用户得到想要的渲染结果。另外,当用户希望下次继续使用满意的渲染效果或快速设置各项参数时,所述程序还支持用户自行导入或导出相关参数。FIG. 4 is an interactive interface that provides a user with multiple editing options according to an embodiment of the present application. As shown in Figure 4, the edit button in the "Color Matching" part of the right half of the figure can be independently matched by the user with the secondary color corresponding to the main color; the edit button in the "Background Color" part allows the user to select the desired target image "Color Offset" and "Dynamic Parameters" allow users to adjust the size of the dynamic area of the rendering; the edit button in the "Preset" section allows users to directly select the preset dynamic effects; "Random function" ” part of the edit button allows the user to select all rendering parameters to be random or part of the parameters to be random, so as to obtain a rendering result that is more in line with the user's wishes. The image display area in the left half can display the original image and the rendering effect after modification of the corresponding parameters, so that the user can obtain the desired rendering result. In addition, when the user wishes to continue to use satisfactory rendering effects or quickly set various parameters next time, the program also supports the user to import or export relevant parameters by himself.
在本申请的一些实施例中,基于改变后的点阵信息对所述三维网格所在的目标图像进行重新渲染,得到渲染图像,具体是通过以下步骤来进行渲染的:确定所述改变后的点阵信息所对应的主色,并依据预设策略在所述主色的周围生成与所述主色搭配的辅色的属性信息,其中,所述属性信息包括以下至少之一:辅色的色相值、饱和度和亮度。In some embodiments of the present application, the target image where the three-dimensional grid is located is re-rendered based on the changed lattice information to obtain a rendered image. Specifically, the rendering is performed by the following steps: determining the changed The main color corresponding to the dot matrix information, and the attribute information of the auxiliary color matched with the main color is generated around the main color according to the preset strategy, wherein the attribute information includes at least one of the following: Hue value, saturation and lightness.
为了实现主色与辅色的协调搭配,所述辅色的属性信息所对应的属性值与所述主色的属性信息所对应的属性值之间的差异小于预设阈值。其中,所述预设阈值可以由用户来自行调节。当用户希望目标图像经过渲染后得到的动态图像,各个色块之间的色彩过渡更加柔和协调一些时,可以将所述阈值设置为一个较小的值;当用户希望目标图像经过渲染后得到的动态图像,各个色块之间的对比更加强烈一些时,可以将所述阈值设置为一个较大的值。In order to realize the coordinated collocation of the main color and the auxiliary color, the difference between the attribute value corresponding to the attribute information of the auxiliary color and the attribute value corresponding to the attribute information of the main color is smaller than a preset threshold. Wherein, the preset threshold can be adjusted by the user. When the user wants the dynamic image obtained after the target image is rendered, the color transition between the color blocks is softer and more harmonious, the threshold can be set to a smaller value; when the user wants the target image to be rendered after rendering In a dynamic image, when the contrast between each color block is stronger, the threshold can be set to a larger value.
另外,图1所述的计算机装置(或终端设备)还可以为用户提供一个如图4所示的操作界面,并执行用户在所述操作界面上的相应操作所发出的指令。所述操作界面可以让用户可自行确定所述辅色的色相值,饱和度和亮度相对于所述主色的变化量。In addition, the computer device (or terminal device) shown in FIG. 1 can also provide the user with an operation interface as shown in FIG. 4 , and execute instructions issued by the user through corresponding operations on the operation interface. The operation interface allows the user to determine the hue value of the secondary color, the variation of saturation and brightness relative to the primary color.
实施例4Example 4
本申请的实施例可以提供一种图像展示方法,如图6所示,包括以下步骤:The embodiment of the present application can provide an image display method, as shown in FIG. 6 , including the following steps:
S602,在编辑界面中展示目标图像和用于对目标图像进行编辑的至少一个编辑选项;S602, displaying the target image and at least one editing option for editing the target image in the editing interface;
其中,上述至少一个编辑选项用于对三维网格的属性进行调整。Wherein, the above at least one editing option is used to adjust the properties of the three-dimensional grid.
在本申请的一些实施例中,上述至少一个编辑选项可以包括以下类型的编辑选项:用于调整主色、辅色以及每个时刻被动态渲染的区域面积大小的第一类编辑选项,和可以让用户直接选择预先设定好的动态效果的第二类编辑选项,以及允许用户选择部分参数随机或全部参数随机的第三类编辑选项。In some embodiments of the present application, the above-mentioned at least one editing option may include the following types of editing options: a first-type editing option for adjusting the main color, the secondary color, and the size of the area that is dynamically rendered at each moment, and may The second type of editing options allows users to directly select preset dynamic effects, and the third type of editing options allows users to select some or all of the parameters at random.
S604,响应于对至少一个编辑选项的编辑操作,对编辑选项对应的图像属性进行配置,并保存配置结果;S604, in response to an editing operation on at least one editing option, configure the image attribute corresponding to the editing option, and save the configuration result;
其中,所述保存的配置结果可以用于快速对图像进行渲染。The saved configuration result can be used to quickly render the image.
S606,基于配置结果对目标图像进行重新渲染,并在编辑界面中展示重新渲染后的目标图像。S606, the target image is re-rendered based on the configuration result, and the re-rendered target image is displayed in the editing interface.
在本申请的一些实施例中,所述编辑界面的第一区域用于展示目标图像,并可以根据第二区域的编辑选项,展示不同的渲染效果。In some embodiments of the present application, the first area of the editing interface is used to display the target image, and may display different rendering effects according to the editing options of the second area.
在本申请的一些实施例中,上述图像展示方法可以通过如图4所示的交互界面来实现。如图4所示,图中右半部分的“色彩搭配”部分的编辑按钮可以由用户自主搭配与主色对应的辅色;“背景颜色”部分的编辑按钮可以让用户选择想要的目标图像的颜色;“色彩偏移”和“动态参数”可以让用户对渲染的动态区域大小等进行调节;“预设”部分的编辑按钮可以让用户直接选择预先设定好的动态效果;“随机功能”部分的编辑按钮可以让用户选择全部渲染参数均随机或部分参数随机,以得到更符合用户意愿的渲染结果。左半部分的图像展示区域,可以展示原图像,以及相应参数修改后的渲染效果,方便用户得到想要的渲染结果。In some embodiments of the present application, the above-mentioned image display method may be implemented through an interactive interface as shown in FIG. 4 . As shown in Figure 4, the edit button in the "Color Matching" part of the right half of the figure can be independently matched by the user with the secondary color corresponding to the main color; the edit button in the "Background Color" part allows the user to select the desired target image "Color Offset" and "Dynamic Parameters" allow users to adjust the size of the dynamic area of the rendering; the edit button in the "Preset" section allows users to directly select the preset dynamic effects; "Random function" ” part of the edit button allows the user to select all rendering parameters to be random or part of the parameters to be random, so as to obtain a rendering result that is more in line with the user's wishes. The image display area in the left half can display the original image and the rendering effect after modification of the corresponding parameters, so that the user can obtain the desired rendering result.
实施例5Example 5
本申请的实施例可以提供一种计算机终端,该计算机终端可以是计算机终端群中的任意一个计算机终端设备。可选地,在本实施例中,上述计算机终端也可以替换为移动终端等终端设备。Embodiments of the present application may provide a computer terminal, where the computer terminal may be any computer terminal device in a computer terminal group. Optionally, in this embodiment, the above-mentioned computer terminal may also be replaced by a terminal device such as a mobile terminal.
可选地,在本实施例中,上述计算机终端可以位于计算机网络的多个网络设备中的至少一个网络设备。Optionally, in this embodiment, the above-mentioned computer terminal may be located in at least one network device among multiple network devices of a computer network.
在本实施例中,上述计算机终端可以执行图像渲染方法中以下步骤的程序代码:在编辑界面中展示接收的待编辑图像;以待编辑图像中的三维网格为单位,对待编辑图像中的点阵信息进行改变,其中,点阵信息包括以下至少之一:点阵的三维坐标,反射强度和颜色信息;基于改变后的点阵信息对待编辑图像进行渲染,得到渲染图像。In this embodiment, the above-mentioned computer terminal may execute the program code of the following steps in the image rendering method: displaying the received image to be edited in the editing interface; The lattice information is changed, wherein the lattice information includes at least one of the following: three-dimensional coordinates of the lattice, reflection intensity and color information; rendering the image to be edited based on the changed lattice information to obtain a rendered image.
采用本申请实施例,提供了一种图像渲染的方案。通过获取目标图像;从目标图像中确定三维网格,并对三维网格中的点阵信息按照预设规则进行改变,其中,点阵信息包括以下至少之一:点阵的三维坐标,反射强度和颜色信息;基于改变后的点阵信息对三维网格所在的目标图像进行重新渲染,得到渲染图像,从而达到了快速生成符合用户需求的高质量的动态色彩图的目的,进而解决了现有技术无法生成符合用户需求的动态色彩渲染图的技术问题。With the embodiments of the present application, an image rendering solution is provided. By acquiring the target image; determining a three-dimensional grid from the target image, and changing the lattice information in the three-dimensional grid according to preset rules, wherein the lattice information includes at least one of the following: the three-dimensional coordinates of the lattice, the reflection intensity and color information; based on the changed lattice information, the target image where the 3D grid is located is re-rendered to obtain a rendered image, so as to achieve the purpose of quickly generating a high-quality dynamic color map that meets the needs of users, and thus solves the problem of existing The technical problem that the technology cannot generate a dynamic color rendering that meets the user's needs.
本领域普通技术人员可以理解,图1所示的结构仅为示意,计算机终端也可以是智能手机(如Android手机、iOS手机等)、平板电脑、掌声电脑以及移动互联网设备(MobileInternet Devices,MID)、PAD等终端设备。图1其并不对上述电子装置的结构造成限定。例如,计算机终端10还可包括比图1中所示更多或者更少的组件(如网络接口、显示装置等),或者具有与图1所示不同的配置。Those of ordinary skill in the art can understand that the structure shown in FIG. 1 is for illustration only, and the computer terminal can also be a smart phone (such as an Android mobile phone, an iOS mobile phone, etc.), a tablet computer, an applause computer, and a Mobile Internet Devices (MID) , PAD and other terminal equipment. FIG. 1 does not limit the structure of the above electronic device. For example, the computer terminal 10 may also include more or fewer components than those shown in FIG. 1 (eg, network interfaces, display devices, etc.), or have a different configuration than that shown in FIG. 1 .
本领域普通技术人员可以理解上述实施例的各种方法中的全部或部分步骤是可以通过程序来指令终端设备相关的硬件来完成,该程序可以存储于一计算机可读存储介质中,存储介质可以包括:闪存盘、只读存储器(Read-Only Memory,ROM)、随机存取器(RandomAccess Memory,RAM)、磁盘或光盘等。Those of ordinary skill in the art can understand that all or part of the steps in the various methods of the above embodiments can be completed by instructing the hardware related to the terminal device through a program, and the program can be stored in a computer-readable storage medium, and the storage medium can Including: flash disk, read-only memory (Read-Only Memory, ROM), random access device (RandomAccess Memory, RAM), magnetic disk or optical disk, etc.
实施例6Example 6
本申请的实施例还提供了一种存储介质。可选地,在本实施例中,上述存储介质可以用于保存上述实施例一所提供的图像渲染方法所执行的程序代码。Embodiments of the present application also provide a storage medium. Optionally, in this embodiment, the above-mentioned storage medium may be used to store the program code executed by the image rendering method provided in the above-mentioned first embodiment.
可选地,在本实施例中,上述存储介质可以位于计算机网络中计算机终端群中的任意一个计算机终端中,或者位于移动终端群中的任意一个移动终端中。Optionally, in this embodiment, the above-mentioned storage medium may be located in any computer terminal in a computer terminal group in a computer network, or in any mobile terminal in a mobile terminal group.
可选地,在本实施例中,存储介质被设置为存储用于执行以下步骤的程序代码:在编辑界面中展示接收的待编辑图像;以待编辑图像中的三维网格为单位,对待编辑图像中的点阵信息进行改变,其中,点阵信息包括以下至少之一:点阵的三维坐标,反射强度和颜色信息;基于改变后的点阵信息对待编辑图像进行渲染,得到渲染图像。Optionally, in this embodiment, the storage medium is set to store program codes for performing the following steps: displaying the received image to be edited in the editing interface; taking the three-dimensional grid in the image to be edited as a unit, The lattice information in the image is changed, wherein the lattice information includes at least one of the following: three-dimensional coordinates of the lattice, reflection intensity and color information; rendering the image to be edited based on the changed lattice information to obtain a rendered image.
上述本申请实施例序号仅仅为了描述,不代表实施例的优劣。The above-mentioned serial numbers of the embodiments of the present application are only for description, and do not represent the advantages or disadvantages of the embodiments.
在本申请的上述实施例中,对各个实施例的描述都各有侧重,某个实施例中没有详述的部分,可以参见其他实施例的相关描述。In the above-mentioned embodiments of the present application, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference may be made to related descriptions of other embodiments.
在本申请所提供的几个实施例中,应该理解到,所揭露的技术内容,可通过其它的方式实现。其中,以上所描述的装置实施例仅仅是示意性的,例如所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,单元或模块的间接耦合或通信连接,可以是电性或其它的形式。In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. The apparatus embodiments described above are only illustrative, for example, the division of the units is only a logical function division, and there may be other division methods in actual implementation, for example, multiple units or components may be combined or Integration into another system, or some features can be ignored, or not implemented. On the other hand, the shown or discussed mutual coupling or direct coupling or communication connection may be through some interfaces, indirect coupling or communication connection of units or modules, and may be in electrical or other forms.
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。The units described as separate components may or may not be physically separated, and components displayed as units may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution in this embodiment.
另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically alone, or two or more units may be integrated into one unit. The above-mentioned integrated units may be implemented in the form of hardware, or may be implemented in the form of software functional units.
所述集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可为个人计算机、服务器或者网络设备等)执行本申请各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、移动硬盘、磁碟或者光盘等各种可以存储程序代码的介质。The integrated unit, if implemented in the form of a software functional unit and sold or used as an independent product, may be stored in a computer-readable storage medium. Based on this understanding, the technical solutions of the present application can be embodied in the form of software products in essence, or the parts that contribute to the prior art, or all or part of the technical solutions, and the computer software products are stored in a storage medium , including several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present application. The aforementioned storage medium includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, magnetic disk or optical disk and other media that can store program codes .
以上所述仅是本申请的优选实施方式,应当指出,对于本技术领域的普通技术人员来说,在不脱离本申请原理的前提下,还可以做出若干改进和润饰,这些改进和润饰也应视为本申请的保护范围。The above are only the preferred embodiments of the present application. It should be pointed out that for those skilled in the art, without departing from the principles of the present application, several improvements and modifications can also be made. It should be regarded as the protection scope of this application.
Claims (13)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110202059.9A CN114972593A (en) | 2021-02-23 | 2021-02-23 | Image rendering method, device and non-volatile storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110202059.9A CN114972593A (en) | 2021-02-23 | 2021-02-23 | Image rendering method, device and non-volatile storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN114972593A true CN114972593A (en) | 2022-08-30 |
Family
ID=82954112
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202110202059.9A Pending CN114972593A (en) | 2021-02-23 | 2021-02-23 | Image rendering method, device and non-volatile storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN114972593A (en) |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
KR20130026853A (en) * | 2011-09-06 | 2013-03-14 | 한국전자통신연구원 | Apparatus and method for rendering of point cloud using voxel grid |
CN111402381A (en) * | 2020-03-17 | 2020-07-10 | 网易(杭州)网络有限公司 | Model rendering method and device and readable storage medium |
CN111508052A (en) * | 2020-04-23 | 2020-08-07 | 网易(杭州)网络有限公司 | Rendering method and device of three-dimensional grid body |
-
2021
- 2021-02-23 CN CN202110202059.9A patent/CN114972593A/en active Pending
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
KR20130026853A (en) * | 2011-09-06 | 2013-03-14 | 한국전자통신연구원 | Apparatus and method for rendering of point cloud using voxel grid |
CN111402381A (en) * | 2020-03-17 | 2020-07-10 | 网易(杭州)网络有限公司 | Model rendering method and device and readable storage medium |
CN111508052A (en) * | 2020-04-23 | 2020-08-07 | 网易(杭州)网络有限公司 | Rendering method and device of three-dimensional grid body |
Non-Patent Citations (1)
Title |
---|
姚丹丹;苗放;陈军;卢涵宇;: "基于OpenGL的ArcGIS Globe动态三维符号渲染可视化研究", 广西大学学报(自然科学版), no. 03, 25 June 2016 (2016-06-25) * |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US8988446B2 (en) | 2D animation from a 3D mesh | |
CN103247064B (en) | A kind of generation method of three-dimensional dynamic graphical, device and mobile terminal | |
CN111583379B (en) | Virtual model rendering method and device, storage medium and electronic equipment | |
JP2023029984A (en) | Method, device, electronic apparatus, and readable storage medium for generating virtual image | |
CN108765520B (en) | Text information rendering method and device, storage medium and electronic device | |
CN111710020B (en) | Animation rendering method and device and storage medium | |
CN111161392A (en) | Video generation method and device and computer system | |
RU2680355C1 (en) | Method and system of removing invisible surfaces of a three-dimensional scene | |
CN109598672B (en) | Map road rendering method and device | |
KR20200131817A (en) | Methods and devices to facilitate 3D object visualization and manipulation for multiple devices | |
CN115803782A (en) | Augmented reality effect of perception geometry with real-time depth map | |
CN104657097A (en) | Method and device for displaying wave-shaped dynamic image | |
CN115311395A (en) | Three-dimensional scene rendering method, device and equipment | |
WO2025031131A1 (en) | Display information processing method and apparatus, and storage medium and electronic apparatus | |
CN114612641A (en) | Material migration method and device and data processing method | |
CN114820908B (en) | Virtual image generation method and device, electronic equipment and storage medium | |
CN114972593A (en) | Image rendering method, device and non-volatile storage medium | |
CN116468839A (en) | Model rendering method and device, storage medium and electronic device | |
CN115035231A (en) | Shadow baking method, shadow baking device, electronic apparatus, and storage medium | |
CN111260768B (en) | Picture processing method and device, storage medium and electronic device | |
CN115330918A (en) | Three-dimensional scene rendering method and device | |
CN118298128B (en) | Three-dimensional grid processing method, device, equipment and readable storage medium | |
CN116778053B (en) | Target engine-based map generation method, device, equipment and storage medium | |
CN113487708B (en) | Flow animation implementation method based on graphics, storage medium and terminal equipment | |
CN114299211A (en) | Information processing method, information processing apparatus, readable storage medium, and electronic apparatus |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |