WO2017206606A1 - 图片的生成方法及装置 - Google Patents

图片的生成方法及装置 Download PDF

Info

Publication number
WO2017206606A1
WO2017206606A1 PCT/CN2017/080863 CN2017080863W WO2017206606A1 WO 2017206606 A1 WO2017206606 A1 WO 2017206606A1 CN 2017080863 W CN2017080863 W CN 2017080863W WO 2017206606 A1 WO2017206606 A1 WO 2017206606A1
Authority
WO
WIPO (PCT)
Prior art keywords
picture
sub
generated
pixel
information
Prior art date
Application number
PCT/CN2017/080863
Other languages
English (en)
French (fr)
Inventor
卢伟勤
Original Assignee
阿里巴巴集团控股有限公司
卢伟勤
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 阿里巴巴集团控股有限公司, 卢伟勤 filed Critical 阿里巴巴集团控股有限公司
Priority to SG11201810297XA priority Critical patent/SG11201810297XA/en
Priority to EP17805551.3A priority patent/EP3468185A1/en
Priority to KR1020187037147A priority patent/KR102242767B1/ko
Priority to JP2018563074A priority patent/JP6903079B2/ja
Priority to MYPI2018002077A priority patent/MY194950A/en
Publication of WO2017206606A1 publication Critical patent/WO2017206606A1/zh
Priority to PH12018502498A priority patent/PH12018502498A1/en
Priority to US16/202,609 priority patent/US10970818B2/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/42Methods or arrangements for coding, decoding, compressing or decompressing digital video signals characterised by implementation details or hardware specially adapted for video compression or decompression, e.g. dedicated software implementation
    • H04N19/423Methods or arrangements for coding, decoding, compressing or decompressing digital video signals characterised by implementation details or hardware specially adapted for video compression or decompression, e.g. dedicated software implementation characterised by memory arrangements
    • H04N19/426Methods or arrangements for coding, decoding, compressing or decompressing digital video signals characterised by implementation details or hardware specially adapted for video compression or decompression, e.g. dedicated software implementation characterised by memory arrangements using memory downsizing methods
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T3/00Geometric image transformations in the plane of the image
    • G06T3/40Scaling of whole images or parts thereof, e.g. expanding or contracting
    • G06T3/4038Image mosaicing, e.g. composing plane images from plane sub-images
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/85Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using pre-processing or post-processing specially adapted for video compression
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/50Information retrieval; Database structures therefor; File system structures therefor of still image data
    • G06F16/58Retrieval characterised by using metadata, e.g. metadata not derived from the content or metadata generated manually
    • G06F16/5866Retrieval characterised by using metadata, e.g. metadata not derived from the content or metadata generated manually using information manually generated, e.g. tags, keywords, comments, manually generated location and time information
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5011Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals
    • G06F9/5016Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals the resource being the memory
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T11/002D [Two Dimensional] image generation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T9/00Image coding
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/134Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or criterion affecting or controlling the adaptive coding
    • H04N19/136Incoming video signal characteristics or properties
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/102Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
    • H04N19/117Filters, e.g. for pre-processing or post-processing
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/102Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
    • H04N19/129Scanning of coding units, e.g. zig-zag scan of transform coefficients or flexible macroblock ordering [FMO]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/134Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or criterion affecting or controlling the adaptive coding
    • H04N19/162User input
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/169Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding
    • H04N19/17Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being an image region, e.g. an object
    • H04N19/174Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being an image region, e.g. an object the region being a slice, e.g. a line of blocks or a group of blocks
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/169Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding
    • H04N19/17Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being an image region, e.g. an object
    • H04N19/176Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being an image region, e.g. an object the region being a block, e.g. a macroblock
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/46Embedding additional information in the video signal during the compression process

Definitions

  • the present application relates to the field of image processing technologies, and in particular, to a method and an apparatus for generating a picture.
  • the conventional technology when generating a target picture, first load or generate a base map in the memory; then draw more picture information on the base map until a complete picture information is formed in the memory; finally, according to the complete picture in the memory Information to generate a target image.
  • the target image is relatively large, the above-mentioned complete picture information saved in the memory will occupy a large amount of memory space. For example, when the target picture is a true color picture of 1024x1024, it will occupy more than 4 megabytes of memory space. The earth consumes the memory resources of the computer.
  • the embodiment of the present application provides a method and a device for generating a picture, which can achieve the purpose of saving memory resources of a computer.
  • a method for generating a picture comprising:
  • a picture generating apparatus comprising:
  • a receiving unit configured to receive a picture generation request, where the picture generation request includes a picture format of a picture to be generated
  • An obtaining unit configured to acquire a corresponding static picture according to the picture generation request received by the receiving unit
  • a determining unit configured to determine, according to the picture format, multiple to-be-generated sub-pictures of the to-be-generated picture
  • a sorting unit configured to acquire description information of each sub-picture to be generated determined by the determining unit, and sort the plurality of sub-pictures to be generated according to the description information
  • a generating unit configured to: in the first one of the plurality of to-be-generated sub-pictures that are sorted by the sorting unit, according to the description information of the first sub-picture to be generated, a preset image generating algorithm, and The static picture generates a first sub-picture;
  • a pre-processing unit configured to pre-process the first sub-picture generated by the generating unit, and add the pre-processed first sub-picture to a picture file that conforms to the picture format;
  • the acquiring unit is further configured to generate, preprocess, and perform, in sequence, on the other sub-pictures to be generated in the plurality of sub-pictures to be generated, according to the manner of generating, pre-processing, and adding the first sub-picture. Add an operation until the picture to be generated is obtained.
  • the method and device for generating a picture determine the description information of each sub-picture to be generated of the picture to be generated according to the picture format of the picture to be generated, and sort the sub-pictures to be generated according to the description information; Sequentially generate each sub-picture, wherein In the process of sequentially generating each sub-picture in order, each sub-picture is pre-processed and added to the picture file; when all the sub-pictures are saved in the picture file, all the sub-pictures are formed. The image to be generated.
  • the present application sequentially generates each sub-picture in order, that is, only needs to save information of one sub-picture in the memory, thereby avoiding the need to save the complete information of the picture to be generated in the memory in the prior art.
  • FIG. 1 is a schematic diagram of a picture synthesizing apparatus provided by the present application.
  • FIG. 2 is a flowchart of a method for generating a picture according to an embodiment of the present application
  • FIG. 3 is a schematic diagram of a sub-picture to be generated provided by the present application.
  • FIG. 4 is a schematic diagram of a device for generating a picture according to another embodiment of the present application.
  • the method and device for generating a picture provided by the application are suitable for generating a picture occupying a large-capacity storage space, and are particularly suitable for generating a picture occupying a large-capacity storage space on a server, where the server corresponds to multiple clients, that is, the server.
  • the picture format of the picture generated by the above generation method includes, but is not limited to, JPEG, TIFF, RAW, BMP, GIF, PNG, and the like.
  • the picture material storage module 101 is configured to store still pictures, such as a background picture and a foreground picture. And static text, etc.; it can be understood that when the picture synthesizing device generates different formats of pictures for different clients, the above static pictures are generally shared.
  • the picture generation service module 102 is configured to receive a picture generation request sent by the client, where the picture generation request may include a picture format of the picture to be generated, and read the corresponding static picture from the picture material storage module 101 according to the picture generation request.
  • the image generation request sent by the client to the image synthesizing device may further include the name of the first image. And the name of the second picture, so that the first picture and the second picture are obtained from the picture material storage module 101 by the picture generation service module 102 according to the name of the first picture and the name of the second picture.
  • the synthesis mode decision module 103 is configured to determine, according to the picture format of the picture to be generated, whether the picture to be generated can be generated by using a block; if the picture to be generated can be generated by the block, the description information of the picture to be generated after the block is also determined.
  • the picture to be generated after the block is also referred to as a sub-picture to be generated, and the description information of the sub-picture to be generated may include the number of pixels included in the sub-picture to be generated and the location of each pixel in the sub-picture to be generated. location information.
  • the result of the determination by the synthesis mode decision module 103 is that the picture to be generated can be generated by the block, and each of the to-be-generated sub-pictures includes 1024 pixels, and the 1024 pixels are included. Is a line, such as the first line or the second line.
  • the picture to be generated is a 1024x1024 JPEG picture
  • the JPEG format picture is displayed in a grid
  • the picture to be generated includes 64x64 squares, and each square contains 16x16 pixels
  • the synthesis mode The result of the determination by the decision module 103 is that the picture to be generated can be generated in blocks, and each sub-picture to be generated includes 16 ⁇ 16 pixels, that is, each sub-picture to be generated includes one square pixel.
  • the synthetic mode decision module 103 is further configured to store a preset picture generation algorithm, where the preset picture algorithm is used to generate each pixel in the sub-picture to be generated.
  • the two-dimensional code coding information corresponding to the user information and a preset picture generation algorithm may be combined to generate a sub-picture to be generated.
  • the two-dimensional code encoding information may be generated by the image generation service module 102 according to the user information, wherein the position and color (eg, black or white) of at least one pixel in the image to be generated are defined.
  • the block generation module 104 is configured to generate pixels in each sub-picture to be generated. Specifically, the block generation module 104 may first receive the picture generation request and the static picture forwarded by the picture generation service module 102, and then send an access request to the synthesis mode decision module 103 to obtain description information and presets of each sub-picture to be generated. a picture generation algorithm, and then generating each sub-picture in turn according to the description information of each sub-picture to be generated, the preset picture generation algorithm, and the above-mentioned still picture.
  • the block storage module 105 is configured to store each pixel generated by the block generation module 104 when each sub-picture is generated, when all the pixels of one sub-picture are generated, that is, when the sub-picture is stored in the block storage module 105.
  • the block storage module 105 transmits all the pixels of one sub-picture to the block code compression module 106. It should be noted that after the block storage module 105 sends all the pixels of one sub-picture to the encoding and compressing module 106, the block storage module 105 can be used to store each pixel of the next sub-picture, that is, the present application.
  • the block storage module 105 can be reused to effectively utilize the memory resources of the computer.
  • the block coding compression module 106 is configured to encode and compress the sub-picture according to the picture format of the picture to be generated. Here, according to the picture format of the picture to be generated, encoding and compressing the picture is a common common technique. This will not be repeated. After the sub-picture is encoded and compressed, the block coding compression module 106 sends the encoded and compressed sub-picture to the file generation module 107.
  • the file generating module 107 is configured to generate a picture file that conforms to the picture format of the picture to be generated at the initial time. It can be understood that the picture file only contains the description information of the picture format of the picture to be generated, and does not include any pixels; Each time after receiving the encoded and compressed sub-picture sent by the block coding compression module 106, the encoded and compressed sub-pictures are added. Add to the above image file. When the file generation module 107 adds all the sub-pictures to the picture file, the necessary information (such as security check information or integrity check information, etc.) is added to the picture file; and then the picture to be generated can be generated.
  • the necessary information such as security check information or integrity check information, etc.
  • the method for generating a picture by the picture synthesizing device can be seen in FIG. 2 .
  • the method may specifically include:
  • Step 210 Receive a picture generation request, where the picture generation request includes a picture format of a picture to be generated.
  • the image generation request here can be sent by the client.
  • Step 220 Acquire a corresponding static picture according to the received picture generation request.
  • the static picture here refers to the picture stored in the picture material storage module 101, which contains static information required to generate a majority of the picture to be generated, for example, it may be a background picture, a foreground picture or a LoGo picture.
  • the image generation service module 102 may send a picture generation request, where the picture generation request includes a picture format of the picture to be generated, where the picture format may be JPEG, TIFF, RAW, BMP, GIF, PNG, etc.
  • the picture generation service module 102 may send a picture generation request, then The above image generation request may further include user information (eg, user account and user avatar).
  • the picture generation service module 102 After receiving the picture generation request including the user information, the picture generation service module 102 generates corresponding two-dimensional code coding information according to the user information.
  • the image generation request may further include a name of the background image and/or the foreground image. If the image generation request includes the name of the background image and/or the foreground image, the image material is selected according to the name of the background image and/or the foreground image. The corresponding background image and/or the foreground image are obtained in the storage module 101; otherwise, the default background image and/or the foreground image are directly obtained from the image material storage module 101.
  • Step 230 Determine, according to the picture format, a plurality of sub-pictures to be generated of the picture to be generated.
  • Step 240 Obtain description information of each sub-picture to be generated, and sort the plurality of sub-pictures to be generated according to the description information.
  • the description information of the sub-picture to be generated includes: the number of pixels included in the sub-picture to be generated and the location information of each pixel in the sub-picture to be generated.
  • the picture generation service module 102 in FIG. 1 may, after acquiring the corresponding static picture from the picture material storage module 101, forward the picture format, the static picture, and the two-dimensional code coding information of the picture to be generated to the block generation module 104;
  • the block generation module 104 may send an access request to the synthesis mode decision module 103, where the access request may include a picture format of the picture to be generated;
  • the synthesis mode decision module 103 determines whether the block can be generated according to the picture format of the picture to be generated. Generating a picture; if the picture to be generated can be generated by the block, determining a plurality of pictures to be generated, and obtaining description information of each picture to be generated.
  • the picture to be generated is a 1024x1024 JPEG picture
  • the JPEG format picture is displayed in a grid
  • the picture to be generated includes 64x64 squares, and each square contains 16x16 pixels
  • the synthesis mode The judgment result of the decision module 103 is Generate a picture to be generated in chunks. Specifically, the total may be divided into 64 sub-pictures to be generated, and each sub-picture to be generated includes 16 ⁇ 16 pixels, that is, each sub-picture to be generated includes a square pixel; then the 64 to be generated may be generated.
  • the pictures are sorted.
  • the 64 sub-pictures to be generated may be sorted according to the position of the square of the pixel included in each sub-picture to be generated, and the sub-pictures to be generated are respectively corresponding to the pictures to be generated. Top to bottom, the first square, the second square, ..., the 64th square arranged from left to right.
  • the synthesis mode decision module 103 may send the sorted description information of each sub-picture to be generated and a preset picture generation algorithm to the block generation module 104.
  • Step 250 Generate a first sub-picture according to the description information of the first sub-picture to be generated, the preset picture generation algorithm, and the static picture, for the first sub-picture to be generated in the plurality of sub-pictures to be generated. image.
  • the first sub-picture to be generated may be the top sub-picture to be generated.
  • the image to be generated usually includes a plurality of pixels (for example, 1024 ⁇ 1024 pixels), and the preset image generation algorithm may be a method for generating each pixel.
  • the first pixel may be any pixel, and the preset image generation algorithm may be defined as follows:
  • the foreground pixel refers to one pixel in the foreground picture
  • the background pixel refers to one pixel in the background picture.
  • the first sub-picture may be generated according to the description information of the first sub-picture to be generated.
  • Position information of the first pixel in the sub-picture to be generated reading the pixel of the corresponding position from the static picture according to the location information, and determining the first pixel according to the pixel of the corresponding position and the preset image generation algorithm; Analogy until each pixel in the first sub-picture to be generated is determined, thereby generating a first sub-picture.
  • the first pixel may be generated by combining a corresponding description file (eg, the above-mentioned two-dimensional code encoding information).
  • the description file defines a position, a color, and the like of at least one pixel in the image to be generated.
  • the first to-be-generated sub-picture determined by the synthesis mode decision module 103 may include pixels of the first row, that is, may include 1024 pixels; and it is assumed that each pixel of the first sub-picture to be generated in the two-dimensional code coding information is defined as follows: Line 1 first: black; line 1 second: white; ...; line 1 1024: white.
  • the first foreground pixel of the first row is read from the foreground picture, and the first row is The first foreground pixel is the first pixel in the first sub-picture to be generated; when the second pixel in the first line is generated, that is, when the second pixel in the first sub-picture to be generated is generated, Reading the second background pixel of the first row from the background image, using the second background pixel of the first row as the second pixel in the first sub-picture to be generated; ...; until determining the first sub-picture to be generated The 1024th pixel in the middle. It can be understood that after the 1024th pixel is generated, that is, after the last pixel of the first to-be-generated sub-picture is generated, the first sub-picture is generated.
  • the block generation module 104 stores the pixel in the block storage module 105 for each pixel in the sub-picture, until the block storage module 105 All the pixels in one sub-picture are stored, as in the foregoing example, until 1024 pixels are stored in the block storage module 105; then the block generation module 104 sends all the pixels of one sub-picture and the format of the picture to be generated to the area.
  • Block compression module 106 It can be understood that, after the block generation module 104 sends all the pixels of one sub-picture to the block compression module 106, the block storage module 105 can be used to store all the pixels of the next sub-picture, that is, in the present application.
  • the block storage module 105 can be reused, thereby improving the utilization of memory resources; in addition, the block storage module 105 in the present application is only used to store all pixels of one sub-picture without storing the entire picture. Information, so it greatly saves the memory resources of the computer.
  • Step 260 Perform pre-processing on the first sub-picture, and add the pre-processed first sub-picture to the picture file that conforms to the picture format.
  • the preprocessing herein may include encoding, compression processing, and the like.
  • the pictures stored on the external storage space of the computer are usually encoded and compressed. Images of different image formats may have different encoding and compression methods. Specifically, after receiving the picture format of the first sub-picture and the picture format of the picture to be generated, the block compression module 106 may encode and compress the first sub-picture according to the picture format of the picture to be generated, where The encoding and compression processing of pictures in different picture formats belong to the traditional common techniques, and will not be repeated here.
  • the block compression module 106 After encoding and compressing the first sub-picture, the block compression module 106 sends the first sub-picture after the encoding and compression processing and the picture format of the picture to be generated to the file generating module 107.
  • the file generating module 107 can initially generate a picture file that conforms to the picture format of the picture to be generated, and the picture file only contains the description information of the picture format of the picture to be generated, and does not include any pixels;
  • the encoded and compressed sub-picture is added to the picture file.
  • Step 270 Perform generation, preprocessing, and adding operations on the other sub-pictures to be generated in the plurality of sub-pictures to be generated in sequence according to the generation, pre-processing, and adding manner of the first sub-picture, until the to-be-generated is obtained. image.
  • a second sub-picture (including 1024 pixels in the second line) may be generated; then the second sub-picture is pre-processed, and the pre-processed second is generated.
  • the sub-pictures are added to the above picture file; and so on, until the 1024th sub-picture is generated, and the pre-processed 1024th sub-picture is added to the above picture file.
  • the file generation module 107 adds all the sub-pictures to the picture file, the necessary information (such as security check information or integrity check information, etc.) is added to the picture file; and then the picture to be generated is generated.
  • the method for generating a picture determines the description information of each sub-picture to be generated of the picture to be generated according to the picture format of the picture to be generated, and sorts each sub-picture to be generated according to the description information; Generating each sub-picture, wherein, in the process of sequentially generating each sub-picture in order, each sub-picture is pre-processed and added to the picture file; and all sub-pictures are saved in the picture file. When all the sub-pictures constitute the picture to be generated.
  • the present application sequentially generates each sub-picture in order, that is, only needs to save information of one sub-picture in the memory, thereby avoiding the need to save the complete information of the picture to be generated in the memory in the prior art.
  • the device includes:
  • the receiving unit 401 is configured to receive a picture generation request, where the picture generation request includes a picture format of the picture to be generated.
  • the obtaining unit 402 is configured to acquire a corresponding static picture according to the picture generation request received by the receiving unit 401.
  • the determining unit 403 is configured to determine, according to the picture format, multiple to-be-generated sub-pictures of the picture to be generated.
  • the sorting unit 404 is configured to acquire description information of each sub-picture to be generated determined by the determining unit 403, and sort the plurality of sub-pictures to be generated according to the description information.
  • the description information may include: the number of pixels included in the sub-picture to be generated and the location information of each pixel in the sub-picture to be generated.
  • the generating unit 405 is configured to: the first to-be-generated sub-picture in the plurality of to-be-generated sub-pictures that are sorted by the sorting unit 404, according to the description information of the first sub-picture to be generated, a preset picture generation algorithm, and a still picture , generating the first sub-picture.
  • the generating unit 405 is specifically configured to:
  • Reading according to the description information of the first sub-picture to be generated, the location information of the first pixel in the first sub-picture to be generated; and reading the pixel of the corresponding position from the static picture according to the location information, and according to the corresponding location
  • the pixel and the preset image generation algorithm determine the first pixel; and so on, until each pixel in the first sub-picture to be generated is determined, thereby generating a first sub-picture.
  • the pre-processing unit 406 is configured to perform pre-processing on the first sub-picture generated by the generating unit 405, and add the pre-processed first sub-picture to the picture file that conforms to the picture format.
  • the obtaining unit 402 is further configured to sequentially generate, pre-process, and add operations on the to-be-generated sub-pictures in the plurality of sub-pictures to be generated, according to the manner of generating, pre-processing, and adding the first sub-picture. Until you get the picture to be generated.
  • the static picture includes a foreground picture and/or a background picture
  • the pixel in the corresponding location is read from the static image, and the first pixel is determined according to the pixel of the corresponding location and the preset image generation algorithm, specifically:
  • the foreground pixel of the corresponding location is read from the foreground image
  • the background pixel of the corresponding location is read from the background image
  • the merged foreground pixel and the background pixel are taken as the first pixel.
  • the image generation request may further include user information
  • the generating unit 405 is also specifically configured to:
  • the first sub-picture is generated according to the description information of the first sub-picture to be generated, the preset picture generation algorithm, the static picture, and the two-dimensional code coding information.
  • the receiving unit 401 receives a picture generation request, where the picture generation request includes a picture format of a picture to be generated, and the obtaining unit 402 acquires a corresponding static picture according to the received picture generation request;
  • the unit 403 determines a plurality of to-be-generated sub-pictures to be generated according to the picture format, and the sorting unit 404 obtains the description information of each sub-picture to be generated, and sorts the plurality of sub-pictures to be generated according to the description information;
  • the unit 406 preprocesses the first sub-picture, and adds the pre-processed first sub-picture to the picture file that conforms to the picture format; the obtaining unit 402 generates, pre-processe
  • the steps of a method or algorithm described in connection with the embodiments disclosed herein can be implemented in hardware, a software module executed by a processor, or a combination of both.
  • the software module can be placed in random access memory (RAM), memory, read only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, removable disk, CD-ROM, or technical field. Any other form of storage medium known.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Databases & Information Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Library & Information Science (AREA)
  • Compression Or Coding Systems Of Tv Signals (AREA)
  • Processing Or Creating Images (AREA)
  • Editing Of Facsimile Originals (AREA)
  • Image Processing (AREA)
  • Television Signal Processing For Recording (AREA)

Abstract

本申请实施例涉及一种图片的生成方法及装置,在一种图片的生成方法中,根据待生成图片的图片格式,确定待生成图片的各个待生成子图片的描述信息,并根据该描述信息,对各个待生成子图片进行排序;之后按照顺序依次生成各个子图片,其中,在按照顺序依次生成各个子图片的过程中,每生成一个子图片,就将该子图片进行预处理后添加到图片文件中;当图片文件中保存了所有的子图片时,所有的子图片构成了待生成图片。由此可以看出,本申请是按照顺序依次生成各个子图片,也即在内存中只需保存一个子图片的信息,从而避免了现有技术中需要在内存中保存待生成图片的完整信息而浪费计算机的内存资源的问题。

Description

图片的生成方法及装置 技术领域
本申请涉及图像处理技术领域,尤其涉及一种图片的生成方法及装置。
背景技术
传统技术中,在生成目标图片时,首先在内存中加载或者生成一张底图;之后在底图上绘制更多图片信息,直至在内存中形成完整的图片信息;最后根据内存中完整的图片信息,生成目标图片。然而当目标图片比较大时,上述在内存中保存的完整的图片信息会占用大量的内存空间,如,在目标图片为1024x1024的真彩色图片时,会占用超过4兆字节内存空间,这极大地耗费了计算机的内存资源。
发明内容
本申请实施例提供了一种图片的生成方法及装置,可以达到节约计算机的内存资源的目的。
第一方面,提供了一种图片的生成方法,该方法包括:
接收图片生成请求,所述图片生成请求包括待生成图片的图片格式;
根据接收的图片生成请求,获取对应的静态图片;
根据所述图片格式,确定所述待生成图片的多个待生成子图片;
获取各待生成子图片的描述信息,并根据所述描述信息,对所述多个待生成子图片进行排序;
对排序后的多个待生成子图片中的第一个待生成子图片,根据所述第一个待生成子图片的描述信息、预设的图片生成算法以及所述静态图片,生成第一个子图片;
对所述第一个子图片进行预处理,将预处理后的第一个子图片添加到符合所述图片格式的图片文件中;
按照对所述第一个子图片的生成、预处理以及添加方式,依次对排序后的多个待生成子图片中的其它待生成子图片进行生成、预处理以及添加操作,直至获得所述待生成图片。
第二方面,提供了一种图片的生成装置,该装置包括:
接收单元,用于接收图片生成请求,所述图片生成请求包括待生成图片的图片格式;
获取单元,用于根据所述接收单元接收的图片生成请求,获取对应的静态图片;
确定单元,用于根据所述图片格式,确定所述待生成图片的多个待生成子图片;
排序单元,用于获取所述确定单元确定的各待生成子图片的描述信息,并根据所述描述信息,对所述多个待生成子图片进行排序;
生成单元,用于对所述排序单元排序后的多个待生成子图片中的第一个待生成子图片,根据所述第一个待生成子图片的描述信息、预设的图片生成算法以及所述静态图片,生成第一个子图片;
预处理单元,用于对所述生成单元生成的所述第一个子图片进行预处理,将预处理后的第一个子图片添加到符合所述图片格式的图片文件中;
所述获取单元,还用于按照对所述第一个子图片的生成、预处理以及添加方式,依次对排序后的多个待生成子图片中的其它待生成子图片进行生成、预处理以及添加操作,直至获得所述待生成图片。
本申请提供的图片的生成方法及装置,根据待生成图片的图片格式,确定待生成图片的各个待生成子图片的描述信息,并根据该描述信息,对各个待生成子图片进行排序;之后按照顺序依次生成各个子图片,其中, 在按照顺序依次生成各个子图片的过程中,每生成一个子图片,就将该子图片进行预处理后添加到图片文件中;当图片文件中保存了所有的子图片时,所有的子图片构成了待生成图片。由此可以看出,本申请是按照顺序依次生成各个子图片,也即在内存中只需保存一个子图片的信息,从而避免了现有技术中需要在内存中保存待生成图片的完整信息而浪费计算机的内存资源的问题。
附图说明
图1为本申请提供的图片合成装置示意图;
图2为本申请一种实施例提供的图片的生成方法流程图;
图3为本申请提供的待生成子图片的示意图;
图4为本申请另一种实施例提供的图片的生成装置示意图。
具体实施方式
下面结合附图,对本发明的实施例进行描述。
本申请提供的图片的生成方法及装置适用于生成占用大容量存储空间的图片,尤其适用于在服务端上生成占用大容量存储空间的图片,其中,服务端对应多个客户端,即服务端为多个客户端提供生成图片的服务。需要说明的是,上述生成方法生成的图片的图片格式包括但不限于JPEG、TIFF、RAW、BMP、GIF、PNG等。
本申请的图片的生成方法可以由图1所示的图片合成装置执行,该图片合成装置可以运行在服务端,如支付宝***的服务端。图1中,包括:图片素材存储模块101、图片生成服务模块102、合成模式决策模块103、区块生成模块104、区块存储模块105、区块编码压缩模块106以及文件生成模块107。
图片素材存储模块101用于存储静态图片,如,背景图片、前景图片 以及静态文字等;可以理解的是,当图片合成装置为不同的客户端生成不同格式的图片时,上述静态图片通常是可以共用的。
图片生成服务模块102用于接收客户端发送的图片生成请求,该图片生成请求中可以包括待生成图片的图片格式,并根据图片生成请求,从图片素材存储模块101中读取对应的静态图片;如,当客户端的用户想生成以第一图片为背景图片,并以第二图片为前景图片的目标图片时,则客户端向图片合成装置发送的图片生成请求中还可以包括第一图片的名称以及第二图片的名称,从而由图片生成服务模块102根据第一图片的名称和第二图片的名称,从图片素材存储模块101获取上述第一图片和第二图片。
合成模式决策模块103用于根据待生成图片的图片格式,来判断是否可以分块生成待生成图片;若可以分块生成待生成图片,则还用于确定分块后的待生成图片的描述信息,此处,分块后的待生成图片也可以称为待生成子图片,待生成子图片的描述信息可以包括待生成子图片中包含的像素的个数以及待生成子图片中各个像素所在的位置信息。举例来说,假设待生成图片为1024x1024的PNG图片,则合成模式决策模块103的判断结果为可以分块生成待生成图片,且每个待生成子图片中包含1024个像素,且该1024个像素为一行,如均为第一行或者第二行等。再例如,假设待生成图片为1024x1024的JPEG图片,因为JPEG格式图片是分格显示的,因此还可以假设该待生成图片包括64x64个方格,且每个方格包含16x16个像素,则合成模式决策模块103的判断结果为可以分块生成待生成图片,且每个待生成子图片中包含16x16个像素,也即每个待生成子图片包含一个方格的像素。此外,合成模式决策模块103还用于存储预设的图片生成算法,该预设的图片算法用于生成待生成子图片中的每个像素。在一个例子中,当要生成包含用户信息的二维码图片时,可以结合与用户信息对应的二维码编码信息及预设的图片生成算法,来生成待生成子图片 中的每个像素。此处,二维码编码信息可以是由图片生成服务模块102根据用户信息生成的,其中定义了待生成图片中至少一个像素的位置以及颜色(如,黑或白)等。
区块生成模块104用于生成每个待生成子图片中的像素。具体地,区块生成模块104可以先接收图片生成服务模块102转发的图片生成请求和静态图片,之后向合成模式决策模块103发送访问请求,以获取每个待生成子图片的描述信息以及预设的图片生成算法,之后根据各个待生成子图片的描述信息、预设的图片生成算法以及上述静态图片,依次生成每个子图片。
区块存储模块105用于存储区块生成模块104在生成每个子图片时生成的每个像素,当一个子图片的所有像素生成完成时,也即当区块存储模块105中存储了一个子图片的所有像素时,区块存储模块105将一个子图片的所有像素发送给区块编码压缩模块106。需要说明的是,在区块存储模块105将一个子图片的所有像素发送给编码压缩模块106之后,则该区块存储模块105可以用于存储下一个子图片的各个像素,也即本申请的区块存储模块105可以被重复利用,从而有效利用了计算机的内存资源。
区块编码压缩模块106用于根据待生成图片的图片格式,对子图片进行编码、压缩处理,此处,根据待生成图片的图片格式,对图片进行编码、压缩处理是传统的常用技术,在此不复赘述。对子图片进行编码、压缩处理之后,区块编码压缩模块106将编码、压缩处理后的子图片发送给文件生成模块107。
文件生成模块107用于在初始时生成符合待生成图片的图片格式的图片文件,可以理解的是,该图片文件只包含了待生成图片的图片格式的描述信息,还没有包含任何的像素;之后每次在接收到区块编码压缩模块106发送的编码、压缩处理后的子图片时,将该编码、压缩处理后的子图片添 加到上述图片文件中。当文件生成模块107将所有的子图片添加到图片文件中时,向图片文件中追加必要的信息(如,安全校验信息或者完整性校验信息等);之后就可以生成待生成图片。
上述图片合成装置生成图片的方法可参见图2所示,图2中,所述方法具体可以包括:
步骤210,接收图片生成请求,该图片生成请求包括待生成图片的图片格式。
此处的图片生成请求可以是由客户端发送的。
步骤220,根据接收的图片生成请求,获取对应的静态图片。
此处的静态图片是指存储在图片素材存储模块101中的图片,其包含了生成多数待生成图片所需的静态信息,如,其可以为背景图片、前景图片或者LoGo图片等。
具体地,当客户端的用户要生成图片时,可以向图片生成服务模块102发送图片生成请求,该图片生成请求包括待生成图片的图片格式,其中,图片格式可以为JPEG、TIFF、RAW、BMP、GIF、PNG等。在一个例子中,当支付客户端的用户想要生成包含用户信息的指定格式的二维码图片(如,PNG格式的二维码图片)时,可以向图片生成服务模块102发送图片生成请求,则上述图片生成请求还可以包括用户信息(如,用户账号和用户头像)。图片生成服务模块102在接收到包括用户信息的图片生成请求之后,根据用户信息生成对应的二维码编码信息。此外,图片生成请求还可以包括背景图片和/或者前景图片的名称,若图片生成请求中包括了背景图片和/或者前景图片的名称,则根据背景图片和/或者前景图片的名称,从图片素材存储模块101中获取对应的背景图片和/或者前景图片;否则,直接从图片素材存储模块101中获取默认的背景图片和/或者前景图片。
步骤230,根据图片格式,确定待生成图片的多个待生成子图片。
此处,待生成子图片是由待生成图片划分的。在一个例子中,当待生成图片为包含用户信息的PNG格式的二维码图片时,确定的多个待生成图片可以如图3所示,图3中,确定了5个待生成子图片,每个待生成子图片为待生成图片中的一行像素。
步骤240,获取各待生成子图片的描述信息,并根据描述信息,对多个待生成子图片进行排序。
待生成子图片的描述信息包括:待生成子图片中包含的像素的个数以及待生成子图片中各个像素所在的位置信息。
图1中的图片生成服务模块102在从图片素材存储模块101中获取到对应的静态图片之后,可以向区块生成模块104转发上述待生成图片的图片格式、静态图片以及二维码编码信息;之后区块生成模块104可以向合成模式决策模块103发送访问请求,该访问请求可以包括待生成图片的图片格式;合成模式决策模块103根据待生成图片的图片格式,来判断是否可以分块生成待生成图片;若可以分块生成待生成图片,则确定多个待生成图片,并获取各待生成图片的描述信息。举例来说,假设待生成图片为1024x1024的PNG图片,则合成模式决策模块103的判断结果为可以分块生成待生成图片。具体的,总共可以确定出1024个待生成子图片,每个待生成子图片中包含1024个像素,且该1024个像素为一行(如,为第1行或者第2行等);之后可以对该1024个待生成子图片进行排序,如,可以按照每个待生成子图片中包含的像素所在的行,对1024个待生成子图片进行排序,排序后的各待生成子图片分别对应待生成图片的第1行、第2行、…、第1024行。
再例如,假设待生成图片为1024x1024的JPEG图片,因为JPEG格式图片是分格显示的,因此还可以假设该待生成图片包括64x64个方格,且每个方格包含16x16个像素,则合成模式决策模块103的判断结果为可 以分块生成待生成图片。具体的,总共可以划分为64个待生成子图片,每个待生成子图片中包含16x16个像素,也即每个待生成子图片包含一个方格的像素;之后可以对该64个待生成子图片进行排序,如,可以按照每个待生成子图片中包含的像素所在方格的位置,对64个待生成子图片进行排序,排序后的各待生成子图片分别对应待生成图片中按照从上到下,从左到右排列的第1个方格、第2个方格、…、第64个方格。
合成模式决策模块103在对多个待生成子图片排序之后,可以将排序后的各个待生成子图片的描述信息以及预设的图片生成算法发送给区块生成模块104。
步骤250,对排序后的多个待生成子图片中的第一个待生成子图片,根据第一个待生成子图片的描述信息、预设的图片生成算法以及静态图片,生成第一个子图片。
需要说明的是,第一个待生成子图片可以为排在最前面的待生成子图片。
可以理解的是,待生成图片通常包含了多个像素(如,1024x1024个像素),则上述预设的图片生成算法可以是定义了每个像素的生成方法。以生成第一像素为例来说,此处,第一像素可以为任一像素,预设的图片生成算法可以定义如下:
根据第一像素的位置信息,从前景图片中读取相应位置的前景像素,将读取的前景像素作为第一像素;或者,根据第一像素的位置信息,从背景图片中读取相应位置的背景像素,将读取的背景像素作为第一像素;或者,根据第一像素的位置信息,从前景图片中读取相应位置的前景像素,并从背景图片中读取相应位置的背景像素,将融合后的前景像素和背景像素作为第一像素。需要说明的是,上述前景像素是指前景图片中的一个像素,而背景像素是指背景图片中的一个像素。
步骤250中根据第一个待生成子图片的描述信息、预设的图片生成算法以及静态图片,生成第一个子图片具体可以为:根据第一个待生成子图片的描述信息,读取第一个待生成子图片中第一像素所在的位置信息;根据位置信息,从静态图片中读取相应位置的像素,并根据相应位置的像素以及预设的图片生成算法,确定第一像素;依次类推,直至确定出第一个待生成子图片中的每个像素,从而生成第一个子图片。
在实际应用中,可以结合相应的描述文件(如,上述二维码编码信息)来生成上述第一像素,此处,描述文件中定义了待生成图片中至少一个像素的位置以及颜色等。
以生成包含用户信息的1024x1024的PNG格式的二维码图片为例来说,
合成模式决策模块103确定的第一个待生成子图片可以包含第1行的像素,即可以包含1024个像素;且假设二维码编码信息中第一个待生成子图片的各像素定义如下:第1行第1个:黑色;第1行第2个:白色;…;第1行第1024个:白色。当生成第1行第1个像素时,也即在生成第一个待生成子图片中的第1个像素时,从前景图片中读取第1行第1个前景像素,将该第1行第1个前景像素作为第一个待生成子图片中的第1个像素;当生成第1行第2个像素时,也即在生成第一个待生成子图片中的第2个像素时,从背景图片中读取第1行第2个背景像素,将第1行第2个背景像素作为第一个待生成子图片中的第2个像素;…;直至确定第一个待生成子图片中第1024个像素。可以理解的是,在第1024个像素生成之后,也即在第一个待生成子图片的最后一个像素生成之后,即生成了第一个子图片。
需要说明的是,步骤250中,区块生成模块104每生成子图片中的一个像素,都将该像素存储在区块存储模块105中,直至区块存储模块105 中存储了一个子图片中的所有像素,如前述例子,直至区块存储模块105中存储了1024个像素;之后区块生成模块104将一个子图片的所有像素以及待生成图片的格式发送给区块压缩模块106。可以理解的是,当区块生成模块104将一个子图片的所有像素发送给区块压缩模块106之后,区块存储模块105可以用于存储下一个子图片的所有像素,也即本申请中的区块存储模块105是可以被重复利用的,从而提高了内存资源的利用率;此外,本申请中的区块存储模块105只用于存储一个子图片的所有像素,而无需存储整个图片的完整信息,所以大大节约了计算机的内存资源。
步骤260,对第一个子图片进行预处理,将预处理后的第一个子图片添加到符合图片格式的图片文件中。
此处的预处理可以包括编码、压缩处理等。
可以理解的是,为了减小图片的存储空间,存储在计算机外部存储空间上的图片通常都是经过编码、压缩处理的。而不同图片格式的图片其编码、压缩处理的方式可能都不相同。具体地,区块压缩模块106在接收到第一个子图片的所有像素以及待生成图片的图片格式之后,可以根据待生成图片的图片格式,对第一个子图片进行编码、压缩处理,其中,不同图片格式的图片的编码、压缩处理过程属于传统的常用技术,在此不复赘述。
区块压缩模块106在对第一个子图片进行编码、压缩处理之后,将编码、压缩处理之后的第一个子图片以及待生成图片的图片格式发送给文件生成模块107。可以理解的是,文件生成模块107可以在初始时生成符合待生成图片的图片格式的图片文件,该图片文件只包含了待生成图片的图片格式的描述信息,还没有包含任何的像素;之后每次在接收到区块编码压缩模块106发送的编码、压缩处理后的子图片时,将该编码、压缩处理后的子图片添加到上述图片文件中。
可以理解的是,此处的编码、压缩处理后的子图片是存储在外部存储 空间(如,磁盘)的,其不再占用内存空间。由此,节约了计算机的内存资源。
步骤270,按照对第一个子图片的生成、预处理以及添加方式,依次对排序后的多个待生成子图片中的其它待生成子图片进行生成、预处理以及添加操作,直至获得待生成图片。
如前述例子,按照第一个子图片的生成方法,可以生成第二个子图片(包含第2行的1024个像素);之后再对第二个子图片进行预处理,并将预处理后的第二个子图片添加到上述图片文件中;依次类推,直至生成第1024个子图片,并将预处理后的第1024个子图片添加到上述图片文件中。当文件生成模块107将所有的子图片添加到图片文件中时,向图片文件中追加必要的信息(如,安全校验信息或者完整性校验信息等);之后便生成了待生成图片。
本申请提供的图片的生成方法,根据待生成图片的图片格式,确定待生成图片的各个待生成子图片的描述信息,并根据该描述信息,对各个待生成子图片进行排序;之后按照顺序依次生成各个子图片,其中,在按照顺序依次生成各个子图片的过程中,每生成一个子图片,就将该子图片进行预处理后添加到图片文件中;当图片文件中保存了所有的子图片时,所有的子图片构成了待生成图片。由此可以看出,本申请是按照顺序依次生成各个子图片,也即在内存中只需保存一个子图片的信息,从而避免了现有技术中需要在内存中保存待生成图片的完整信息而浪费计算机的内存资源的问题。
与上述图片的生成方法对应地,本申请实施例还提供的一种图片的生成装置,如图4所示,该装置包括:
接收单元401,用于接收图片生成请求,该图片生成请求包括待生成图片的图片格式。
获取单元402,用于根据接收单元401接收的图片生成请求,获取对应的静态图片。
确定单元403,用于根据图片格式,确定待生成图片的多个待生成子图片。
排序单元404,用于获取确定单元403确定的各待生成子图片的描述信息,并根据描述信息,对多个待生成子图片进行排序。
其中,描述信息可以包括:待生成子图片中包含的像素的个数以及待生成子图片中各个像素所在的位置信息。
生成单元405,用于对排序单元404排序后的多个待生成子图片中的第一个待生成子图片,根据第一个待生成子图片的描述信息、预设的图片生成算法以及静态图片,生成第一个子图片。
生成单元405具体用于:
根据第一个待生成子图片的描述信息,读取第一个待生成子图片中第一像素所在的位置信息;根据位置信息,从静态图片中读取相应位置的像素,并根据相应位置的像素以及预设的图片生成算法,确定第一像素;依次类推,直至确定出第一个待生成子图片中的每个像素,从而生成第一个子图片。
预处理单元406,用于对生成单元405生成的第一个子图片进行预处理,将预处理后的第一个子图片添加到符合图片格式的图片文件中。
获取单元402,还用于按照对第一个子图片的生成、预处理以及添加方式,依次对排序后的多个待生成子图片中的其它待生成子图片进行生成、预处理以及添加操作,直至获得待生成图片。
可选地,静态图片包括前景图片和/或背景图片;
上述根据位置信息,从静态图片中读取相应位置的像素,并根据相应位置的像素以及预设的图片生成算法,确定第一像素,具体为:
根据位置信息,从前景图片中读取相应位置的前景像素,将前景像素作为第一像素;或者,
根据位置信息,从背景图片中读取相应位置的背景像素,将背景像素作为第一像素;或者,
根据位置信息,从前景图片中读取相应位置的前景像素,并从背景图片中读取相应位置的背景像素,将融合后的前景像素和背景像素作为第一像素。
可选地,图片生成请求还可以包括用户信息;
生成单元405还具体用于:
根据用户信息,生成二维码编码信息;
根据第一个待生成子图片的描述信息、预设的图片生成算法、静态图片以及二维码编码信息,生成第一个子图片。
本申请实施例装置的各功能模块的功能,可以通过上述方法实施例的各步骤来实现,因此,本申请提供的装置的具体工作过程,在此不复赘述。
本申请实施例提供的图片的生成方法及装置,接收单元401接收图片生成请求,该图片生成请求包括待生成图片的图片格式;获取单元402根据接收的图片生成请求,获取对应的静态图片;确定单元403根据图片格式,确定待生成图片的多个待生成子图片;排序单元404获取各待生成子图片的描述信息,并根据描述信息,对多个待生成子图片进行排序;生成单元405对排序后的多个待生成子图片中的第一个待生成子图片,根据第一个待生成子图片的描述信息、预设的图片生成算法以及静态图片,生成第一个子图片;预处理单元406对第一个子图片进行预处理,将预处理后的第一个子图片添加到符合图片格式的图片文件中;获取单元402按照对第一个子图片的生成、预处理以及添加方式,依次对排序后的多个待生成子图片中的其它待生成子图片进行生成、预处理以及添加操作,直至获得 待生成图片。由此,达到了节约计算机的内存资源的目的。
专业人员应该还可以进一步意识到,结合本文中所公开的实施例描述的各示例的对象及算法步骤,能够以电子硬件、计算机软件或者二者的结合来实现,为了清楚地说明硬件和软件的可互换性,在上述说明中已经按照功能一般性地描述了各示例的组成及步骤。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。
结合本文中所公开的实施例描述的方法或算法的步骤可以用硬件、处理器执行的软件模块,或者二者的结合来实施。软件模块可以置于随机存储器(RAM)、内存、只读存储器(ROM)、电可编程ROM、电可擦除可编程ROM、寄存器、硬盘、可移动磁盘、CD-ROM、或技术领域内所公知的任意其它形式的存储介质中。
以上所述的具体实施方式,对本申请的目的、技术方案和有益效果进行了进一步详细说明,所应理解的是,以上所述仅为本申请的具体实施方式而已,并不用于限定本申请的保护范围,凡在本申请的精神和原则之内,所做的任何修改、等同替换、改进等,均应包含在本申请的保护范围之内。

Claims (10)

  1. 一种图片的生成方法,其特征在于,该方法包括:
    接收图片生成请求,所述图片生成请求包括待生成图片的图片格式;
    根据接收的图片生成请求,获取对应的静态图片;
    根据所述图片格式,确定所述待生成图片的多个待生成子图片;
    获取各待生成子图片的描述信息,并根据所述描述信息,对所述多个待生成子图片进行排序;
    对排序后的多个待生成子图片中的第一个待生成子图片,根据所述第一个待生成子图片的描述信息、预设的图片生成算法以及所述静态图片,生成第一个子图片;
    对所述第一个子图片进行预处理,将预处理后的第一个子图片添加到符合所述图片格式的图片文件中;
    按照对所述第一个子图片的生成、预处理以及添加方式,依次对排序后的多个待生成子图片中的其它待生成子图片进行生成、预处理以及添加操作,直至获得所述待生成图片。
  2. 根据权利要求1所述的方法,其特征在于,所述描述信息包括:待生成子图片中包含的像素的个数以及待生成子图片中各个像素所在的位置信息。
  3. 根据权利要求1或2所述的方法,其特征在于,所述根据所述第一个待生成子图片的描述信息、预设的图片生成算法以及所述静态图片,生成第一个子图片,具体为:
    根据所述第一个待生成子图片的描述信息,读取所述第一个待生成子图片中第一像素所在的位置信息;根据所述位置信息,从所述静态图片中读取相应位置的像素,并根据相应位置的像素以及预设的图片生成算法,确定所述第一像素;依次类推,直至确定出所述第一个待生成子图片中的 每个像素,从而生成所述第一个子图片。
  4. 根据权利要求3所述的方法,其特征在于,所述静态图片包括前景图片和/或背景图片;
    所述根据所述位置信息,从所述静态图片中读取相应位置的像素,并根据相应位置的像素以及预设的图片生成算法,确定所述第一像素,具体为:
    根据所述位置信息,从前景图片中读取相应位置的前景像素,将所述前景像素作为第一像素;或者,
    根据所述位置信息,从背景图片中读取相应位置的背景像素,将所述背景像素作为第一像素;或者,
    根据所述位置信息,从前景图片中读取相应位置的前景像素,并从背景图片中读取相应位置的背景像素,将融合后的所述前景像素和背景像素作为所述第一像素。
  5. 根据权利要求1-4任一项所述的方法,其特征在于,所述图片生成请求还包括用户信息;
    根据所述第一个待生成子图片的描述信息、预设的图片生成算法以及所述静态图片,生成第一个子图片,具体为:
    根据所述用户信息,生成二维码编码信息;
    根据所述第一个待生成子图片的描述信息、预设的图片生成算法、所述静态图片以及所述二维码编码信息,生成所述第一个子图片。
  6. 一种图片的生成装置,其特征在于,该装置包括:
    接收单元,用于接收图片生成请求,所述图片生成请求包括待生成图片的图片格式;
    获取单元,用于根据所述接收单元接收的图片生成请求,获取对应的静态图片;
    确定单元,用于根据所述图片格式,确定所述待生成图片的多个待生成子图片;
    排序单元,用于获取所述确定单元确定的各待生成子图片的描述信息,并根据所述描述信息,对所述多个待生成子图片进行排序;
    生成单元,用于对所述排序单元排序后的多个待生成子图片中的第一个待生成子图片,根据所述第一个待生成子图片的描述信息、预设的图片生成算法以及所述静态图片,生成第一个子图片;
    预处理单元,用于对所述生成单元生成的所述第一个子图片进行预处理,将预处理后的第一个子图片添加到符合所述图片格式的图片文件中;
    所述获取单元,还用于按照对所述第一个子图片的生成、预处理以及添加方式,依次对排序后的多个待生成子图片中的其它待生成子图片进行生成、预处理以及添加操作,直至获得所述待生成图片。
  7. 根据权利要求6所述的装置,其特征在于,所述描述信息包括:待生成子图片中包含的像素的个数以及待生成子图片中各个像素所在的位置信息。
  8. 根据权利要求6或7所述的装置,其特征在于,所述生成单元具体用于:
    根据所述第一个待生成子图片的描述信息,读取所述第一个待生成子图片中第一像素所在的位置信息;根据所述位置信息,从所述静态图片中读取相应位置的像素,并根据相应位置的像素以及预设的图片生成算法,确定所述第一像素;依次类推,直至确定出所述第一个待生成子图片中的每个像素,从而生成所述第一个子图片。
  9. 根据权利要求8所述的装置,其特征在于,所述静态图片包括前景图片和/或背景图片;
    所述根据所述位置信息,从所述静态图片中读取相应位置的像素,并 根据相应位置的像素以及预设的图片生成算法,确定所述第一像素,具体为:
    根据所述位置信息,从前景图片中读取相应位置的前景像素,将所述前景像素作为第一像素;或者,
    根据所述位置信息,从背景图片中读取相应位置的背景像素,将所述背景像素作为第一像素;或者,
    根据所述位置信息,从前景图片中读取相应位置的前景像素,并从背景图片中读取相应位置的背景像素,将融合后的所述前景像素和背景像素作为所述第一像素。
  10. 根据权利要求6-9任一项所述的装置,其特征在于,所述图片生成请求还包括用户信息;
    所述生成单元还具体用于:
    根据所述用户信息,生成二维码编码信息;
    根据所述第一个待生成子图片的描述信息、预设的图片生成算法、所述静态图片以及所述二维码编码信息,生成所述第一个子图片。
PCT/CN2017/080863 2016-05-31 2017-04-18 图片的生成方法及装置 WO2017206606A1 (zh)

Priority Applications (7)

Application Number Priority Date Filing Date Title
SG11201810297XA SG11201810297XA (en) 2016-05-31 2017-04-18 Image generation method and device
EP17805551.3A EP3468185A1 (en) 2016-05-31 2017-04-18 Image generation method and device
KR1020187037147A KR102242767B1 (ko) 2016-05-31 2017-04-18 이미지 생성 방법 및 디바이스
JP2018563074A JP6903079B2 (ja) 2016-05-31 2017-04-18 画像生成方法及びデバイス
MYPI2018002077A MY194950A (en) 2016-05-31 2017-04-18 Image generation method and device
PH12018502498A PH12018502498A1 (en) 2016-05-31 2018-11-26 Image generation method and device
US16/202,609 US10970818B2 (en) 2016-05-31 2018-11-28 Sub-image based image generation

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201610374626.8 2016-05-31
CN201610374626.8A CN107452041B (zh) 2016-05-31 2016-05-31 图片的生成方法及装置

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US16/202,609 Continuation US10970818B2 (en) 2016-05-31 2018-11-28 Sub-image based image generation

Publications (1)

Publication Number Publication Date
WO2017206606A1 true WO2017206606A1 (zh) 2017-12-07

Family

ID=60479607

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2017/080863 WO2017206606A1 (zh) 2016-05-31 2017-04-18 图片的生成方法及装置

Country Status (10)

Country Link
US (1) US10970818B2 (zh)
EP (1) EP3468185A1 (zh)
JP (1) JP6903079B2 (zh)
KR (1) KR102242767B1 (zh)
CN (1) CN107452041B (zh)
MY (1) MY194950A (zh)
PH (1) PH12018502498A1 (zh)
SG (1) SG11201810297XA (zh)
TW (1) TWI706371B (zh)
WO (1) WO2017206606A1 (zh)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112771578A (zh) * 2018-09-27 2021-05-07 渊慧科技有限公司 使用细分缩放和深度上缩放的图像生成
CN113284201A (zh) * 2021-05-27 2021-08-20 杭州睿影科技有限公司 安检图像的生成方法、安检***及存储介质

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107452041B (zh) * 2016-05-31 2020-07-31 阿里巴巴集团控股有限公司 图片的生成方法及装置
US20220343544A1 (en) * 2021-04-26 2022-10-27 The Boeing Company Dividing an astc texture to a set of sub-images

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8503802B1 (en) * 2006-12-21 2013-08-06 Marvell International Ltd. Method and apparatus for processing an image
CN105245881A (zh) * 2015-09-28 2016-01-13 杭州九言科技股份有限公司 一种数字图像滤镜处理的方法和装置
CN105488132A (zh) * 2015-11-25 2016-04-13 小米科技有限责任公司 头像图片获取方法及装置
CN105516618A (zh) * 2014-09-27 2016-04-20 北京金山安全软件有限公司 一种制作视频的方法、装置及通信终端

Family Cites Families (32)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5668897A (en) * 1994-03-15 1997-09-16 Stolfo; Salvatore J. Method and apparatus for imaging, image processing and data compression merge/purge techniques for document image databases
WO1997006512A2 (en) * 1995-08-04 1997-02-20 Microsoft Corporation Method and system for rendering graphical objects to image chunks and combining image layers into a display image
US6141012A (en) * 1997-03-31 2000-10-31 Xerox Corporation Image processing code generation based on structured image (SI) techniques
US6611241B1 (en) * 1997-12-02 2003-08-26 Sarnoff Corporation Modular display system
TWI384413B (zh) * 2006-04-24 2013-02-01 Sony Corp An image processing apparatus, an image processing method, an image processing program, and a program storage medium
KR100827679B1 (ko) * 2006-08-16 2008-05-07 엠텍비젼 주식회사 통합 비디오 코덱을 위한 트랜스폼 모듈 및 방법
DE102006039389A1 (de) * 2006-08-22 2008-02-28 Fraunhofer-Gesellschaft zur Förderung der angewandten Forschung e.V. Vorrichtung und Verfahren zur Reduzierung von Übergangsartefakten in einem Gesamtbild, das sich aus Teilbildern zusammensetzt
JP4945236B2 (ja) * 2006-12-27 2012-06-06 株式会社東芝 映像コンテンツ表示装置、映像コンテンツ表示方法及びそのプログラム
JP4831349B2 (ja) * 2007-01-23 2011-12-07 富士ゼロックス株式会社 画像処理装置、画像形成装置、画像形成システム、及びプログラム
WO2008149363A2 (en) * 2007-06-05 2008-12-11 Dblur Technologies Ltd. Non-linear transformations for enhancement of images
US8004582B2 (en) * 2007-12-14 2011-08-23 Casio Computer Co., Ltd. Image file processing apparatus, image file processing method, and storage medium
US8369652B1 (en) * 2008-06-16 2013-02-05 Hrl Laboratories, Llc Visual attention system for salient regions in imagery
TW201023094A (en) * 2008-12-05 2010-06-16 Univ Lunghwa Sci & Technology Method for editing and transmitting network picture in dot matrix manner
JP2012523765A (ja) * 2009-04-08 2012-10-04 ウォッチイットゥー インコーポレイテッド 画像圧縮のためのシステム及び方法
TW201044314A (en) * 2009-06-12 2010-12-16 Int Games System Co Ltd Joint dynamic image editing system and method thereof
US8751677B2 (en) * 2009-10-08 2014-06-10 Futurewei Technologies, Inc. System and method to support different ingest and delivery schemes for a content delivery network
KR20120037330A (ko) * 2010-10-11 2012-04-19 (주) 나무인터넷 이미지객체를 이용한 로그인 인증 방법 및 그 시스템
US8965140B1 (en) * 2011-01-31 2015-02-24 Teradici Corporation Method and apparatus for encoding mixed content image sequences
CN102622628B (zh) 2012-02-24 2014-09-03 南京大学 一种通过渲染方式生成qr码的方法
CN102651138B (zh) * 2012-04-10 2014-11-26 西安理工大学 基于jpeg图片拼接的超大图片合成方法
US9538183B2 (en) * 2012-05-18 2017-01-03 Home Box Office, Inc. Audio-visual content delivery with partial encoding of content chunks
TWI457623B (zh) * 2012-08-24 2014-10-21 Extend Optronics Corp 隔熱光導膜結構及其裝置
KR101509877B1 (ko) * 2013-01-21 2015-04-07 에스케이씨앤씨 주식회사 이미지로부터 생성한 워터마크를 이미지에 삽입하는 기법에 의한 워터마킹 방법 및 장치
US10068363B2 (en) * 2013-03-27 2018-09-04 Nokia Technologies Oy Image point of interest analyser with animation generator
US9210434B2 (en) * 2013-06-12 2015-12-08 Microsoft Technology Licensing, Llc Screen map and standards-based progressive codec for screen content coding
AU2013273768A1 (en) * 2013-12-20 2015-07-09 Canon Kabushiki Kaisha Parallel rendering of region-based graphics representations
CN103778631B (zh) * 2014-01-16 2017-01-18 西安理工大学 基于jpeg文件流的图片分割方法
CN104143109B (zh) * 2014-01-28 2017-04-05 深圳市雁联计算***有限公司 一种二维码的编码和解码方法及其印刷物
US9176473B1 (en) * 2015-02-09 2015-11-03 Nanografix Corporation Systems and methods for fabricating variable digital optical images using generic optical matrices
CN104881470B (zh) * 2015-05-28 2018-05-08 暨南大学 一种面向海量图片数据的重复数据删除方法
CN107452041B (zh) * 2016-05-31 2020-07-31 阿里巴巴集团控股有限公司 图片的生成方法及装置
US10318573B2 (en) * 2016-06-22 2019-06-11 Oath Inc. Generic card feature extraction based on card rendering as an image

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8503802B1 (en) * 2006-12-21 2013-08-06 Marvell International Ltd. Method and apparatus for processing an image
CN105516618A (zh) * 2014-09-27 2016-04-20 北京金山安全软件有限公司 一种制作视频的方法、装置及通信终端
CN105245881A (zh) * 2015-09-28 2016-01-13 杭州九言科技股份有限公司 一种数字图像滤镜处理的方法和装置
CN105488132A (zh) * 2015-11-25 2016-04-13 小米科技有限责任公司 头像图片获取方法及装置

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
See also references of EP3468185A4 *

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112771578A (zh) * 2018-09-27 2021-05-07 渊慧科技有限公司 使用细分缩放和深度上缩放的图像生成
CN112771578B (zh) * 2018-09-27 2024-05-24 渊慧科技有限公司 使用细分缩放和深度上缩放的图像生成
CN113284201A (zh) * 2021-05-27 2021-08-20 杭州睿影科技有限公司 安检图像的生成方法、安检***及存储介质

Also Published As

Publication number Publication date
MY194950A (en) 2022-12-28
TWI706371B (zh) 2020-10-01
US20190108616A1 (en) 2019-04-11
EP3468185A4 (en) 2019-04-10
JP2019517696A (ja) 2019-06-24
EP3468185A1 (en) 2019-04-10
KR20190013870A (ko) 2019-02-11
TW201743283A (zh) 2017-12-16
KR102242767B1 (ko) 2021-04-23
US10970818B2 (en) 2021-04-06
CN107452041A (zh) 2017-12-08
PH12018502498A1 (en) 2019-04-08
JP6903079B2 (ja) 2021-07-14
SG11201810297XA (en) 2018-12-28
CN107452041B (zh) 2020-07-31

Similar Documents

Publication Publication Date Title
KR102431117B1 (ko) 포인트 클라우드 맵핑
WO2017206606A1 (zh) 图片的生成方法及装置
US20200302578A1 (en) Point cloud geometry padding
US8077986B2 (en) Information processing apparatus, method of controlling same and computer program
US20100250588A1 (en) Image searching system and image searching method
US20040165782A1 (en) Image processing apparatus
JP2007074030A (ja) 画像処理装置及び方法
Yue et al. SIFT-based image compression
US20180184096A1 (en) Method and apparatus for encoding and decoding lists of pixels
CN107241597B (zh) 一种结合四叉树自适应编码的可逆信息隐藏方法
JP2006197178A (ja) 画像処理装置および画像処理方法およびプログラムおよび記憶媒体
JP2019517696A5 (zh)
JP2013125994A (ja) 画像圧縮装置、画像圧縮方法、コンピュータプログラム
JP3287469B2 (ja) 画像ファイル記憶方法、デジタル・カメラ及び記憶媒体
JP2003244447A (ja) 画像処理装置及び画像処理方法
JP2017211936A (ja) 文書保存処理システム
TW202036483A (zh) 拼貼擴充方法、編碼器與解碼器
CN103034972B (zh) 图像处理平台的实现方法及图像处理平台
JP2023522456A (ja) マルチビュービデオシーケンスをコード化および復号するための方法およびデバイス
Shao et al. Inter-picture prediction based on 3D point cloud model
US20150278636A1 (en) Image processing apparatus, image processing method, and recording medium
JP2003338934A (ja) 画像処理装置および方法
KR102332203B1 (ko) 방향의 대칭성을 이용한 영상 코딩 장치의 신호 처리 방법
JP4383187B2 (ja) 画像処理装置、画像処理用プログラム及び記憶媒体
JP2006222940A (ja) 画像処理装置

Legal Events

Date Code Title Description
ENP Entry into the national phase

Ref document number: 2018563074

Country of ref document: JP

Kind code of ref document: A

NENP Non-entry into the national phase

Ref country code: DE

121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 17805551

Country of ref document: EP

Kind code of ref document: A1

ENP Entry into the national phase

Ref document number: 20187037147

Country of ref document: KR

Kind code of ref document: A

ENP Entry into the national phase

Ref document number: 2017805551

Country of ref document: EP

Effective date: 20190102