CN106856001A - The store method of gray level image and the acquisition methods of gray level image original pixels - Google Patents

The store method of gray level image and the acquisition methods of gray level image original pixels Download PDF

Info

Publication number
CN106856001A
CN106856001A CN201611122899.XA CN201611122899A CN106856001A CN 106856001 A CN106856001 A CN 106856001A CN 201611122899 A CN201611122899 A CN 201611122899A CN 106856001 A CN106856001 A CN 106856001A
Authority
CN
China
Prior art keywords
pixel value
gray level
level image
passage
original
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201611122899.XA
Other languages
Chinese (zh)
Inventor
彭志勇
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Individual
Original Assignee
Individual
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 Individual filed Critical Individual
Priority to CN201611122899.XA priority Critical patent/CN106856001A/en
Publication of CN106856001A publication Critical patent/CN106856001A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/90Dynamic range modification of images or parts thereof
    • G06T5/92Dynamic range modification of images or parts thereof based on global image properties
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/957Browsing optimisation, e.g. caching or content distillation
    • G06F16/9577Optimising the visualization of content, e.g. distillation of HTML documents

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • General Engineering & Computer Science (AREA)
  • Image Processing (AREA)

Abstract

The invention provides a kind of store method of gray level image, the method includes:Gray level image is saved as the PNG images of RGB or RGBA forms.Present invention also offers a kind of method of the original pixels for obtaining the gray level image that method described above is preserved, the method includes:Based on the mode, the pixel value corresponding to each passage is taken out in R, G, B or R of PNG images, the passage of G, B, A respectively from RGB the or RGBA forms;Certain digit is moved to the left by the pixel value taking-up of each passage and respectively by the pixel value, every section of pixel value after finally moving to left is added, and thus obtains the original pixel value of the gray level image;Or by the pixel value of each passage take out and respectively by the pixel value to the left certain digit after, then by displacement after the pixel value be integrally moved to the left certain digit, thus obtain the pixel value of the most original.The above method can solve the problem that browser can cause the problem of gray level image loss of significance when parsing or showing PNG images.

Description

The store method of gray level image and the acquisition methods of gray level image original pixels
Technical field
The present invention relates to the store method and the acquisition methods of gray level image original pixels of gray level image, especially with PNG files preserve the acquisition methods of the method for gray level image and the original pixels of the gray level image preserved with PNG file formats.
Background technology
Because browser is when parsing or showing the PNG images of 16, the ash for the PNG of 16 being compressed into 8 can be given tacit consent to Degree image, thus decoded using Image the or Canvas objects of browser and 16 gray scales of display PNG when, cause gray scale The loss of the precision of image.
For example, being loaded directly into PNG images using Image objects, then painted using the Drawimage methods of Canvas images The PNG images for just having loaded are made, and passes through the pixel value that the get imagedata methods of Canvas images obtain designated area; Or after using Image objects being loaded directly into PNG images, the Image is directly become WebGL (Web Graphics Library, a kind of 3D drafting standards) inner texture object (textture), become language (GLSL) in the Shader of WebGL Directly use certain pixel value put of texture.WebGL has done normalized, i.e., the pixel value of 8 can be become 0 divided by 255 To 1 decimal.Gray level image for 16, WebGL can first become image the gray level image of 8, then normalize again Treatment, that is, do not have the detailed information of least-significant byte in the decimal for generating.
The content of the invention
Store method and the acquisition side of gray level image original pixels it is an object of the invention to provide a kind of gray level image Method,
To solve the problems, such as that browser can cause gray level image loss of significance when parsing or showing PNG images.
The present invention proposes a kind of store method of gray level image, including:
The pixel value of the gray level image is intercepted into several sections in a certain way, R, G, B or R, G, B, A is respectively stored in Each passage in.
Preferred scheme is:Also include:
Random value is added in some no passages.
The present invention proposes a kind of the original of the gray level image that method obtained as described in above-mentioned any claim is preserved The method of pixel, including:
Based on the mode, in R, G, B or R of PNG images, the passage of G, B, A respectively from RGB the or RGBA forms Take out the pixel value corresponding to each passage;
Certain digit is moved to the left by the pixel value taking-up of each passage and respectively by the pixel value, after finally moving to left Every section of pixel value be added, thus obtain the original pixel value of the gray level image;Or
By the pixel value of each passage take out and respectively by the pixel value to the left certain digit after, then by the institute after displacement State pixel value and be integrally moved to the left certain digit, thus obtain the pixel value of the most original.
Preferably, the pixel value of each passage is taken out and respectively by the pixel value certain digit to the left, including:
The pixel value of each passage is taken out and 2 are multiplied by respectivelyN, wherein, N is that every section of pixel moves to left digit, equal to ash Product of the degree image digit divided by the pixel value hop count after the business that obtains after interception hop count and every section of pixel.
As seen from the above, can directly be decoded using browser Canvas and Image and be preserved by above-mentioned store method Gray level image, and the original gradation picture of each pixel can be obtained by the method for the original pixels of above-mentioned acquisition gray level image Element value, does not result in the loss of picture quality details.
Specific embodiment
With reference to specific embodiment, the store method of the gray level image of present invention offer is discussed in detail.
In the present embodiment, the store method of the gray level image that the present invention is provided includes:By gray level image save as RGB or The PNG images of RGBA forms.
In the present embodiment, when preserving the gray level image more than 8,16 gray scale PNG formats are not used, and use RGB Or the PNG picture formats of RGBA forms.
By taking the PNG picture formats that gray level image is saved as into RGBA forms as an example, specifically, the gray scale of actual number of bits The pixel value of image intercepts into several sections in a certain way, be respectively stored in R G in B, A each passage.
For example, the gray level image for 16, the pixel value storage of the most-significant byte of the gray level image is (red in R Color) or G (green) passage, the pixel value of the least-significant byte of the gray level image is present in G or R passages.
When theoretically, from the PNG format of the mode of RGBA, highest can preserve the gray level image of 32.In reality Using when, for encryption or some other factor consider when, original gray value can be splitted into multistage and be stored in different colors In passage, and some values are added in some no passages, thus can make ordinary person cannot Direct Recognition go out original image, realize The encryption of original image.For example, the gray level image for 10, can put the pixel value of 5 high of the gray level image Enter R passages, the pixel value of low 5 is put into channel B, 3 high of the two Color Channels and G passages are put into some for upsetting The random value of human eye, make naked eyes cannot Direct Recognition go out acquiescence decoding image.Can also be by the gray level image of 16, with from height To low 655 mode, that is, the value for intercepting 11-16 is put into R passages, and 6-10 is put into G passages, and 1-5 is put into channel B.The present invention Embodiment is not limited to above-mentioned segmented mode, and image segmentation mode can be also flexibly set according to actual needs.
Present invention also offers a kind of acquisition methods of gray level image original pixels, specifically include:
Based on above-mentioned pixel value interception way, the pixel corresponding to each passage is taken out from R, G, B, A channel respectively Value, original pixel value is can obtain by calculating.
Specifically, when the pixel value participation calculating of original DICOM images is needed, for above-mentioned gray level image The gray level image that store method is preserved, when the original pixel value of the gray level image is needed, the passage in its PNG picture format Pixel value take out respectively and be moved to the left certain digit, that is, be multiplied by 2N(N is that every section of pixel moves to left digit, equal to gray-scale map 16 gray level images are intercepted into two by image position number divided by the product of the pixel value hop count after business and every section of pixel of interception hop count Section, as a example by every section of each 8 pixel value, during reduction, high-order pixel value is moved to the left digit for 16/2*1, because remaining one section thereafter The pixel value of least-significant byte;And the pixel value of low level need not then be moved to the left, that is, 16/2*0=0 is moved to the left, because the picture of low level There is no remaining pixel value section after plain value;It is intercepted into as a example by four sections by 16 gray level images again, every section of 4 pixel values, is reduced When, high-order pixel value should be moved to the left 16/4*3=12, because of 3 sections of pixel values of residue thereafter;Secondary high-order pixel value should be to Move left 16/4*2=8;Then secondary high-order pixel value is moved to the left 16/4*1=4;Similarly the pixel value of low level is to the left Mobile 16/4*0=0, because in the absence of other pixel values section after low level pixel value), every section of pixel value phase after finally moving to left Plus obtain the original pixel value of the gray level image.For example, being saved as 16 gray-scale maps of rgb format PNG images in reduction During picture, high-order 8 pixel values being stored in R, G, B in a certain passage are multiplied by 28(being moved to the left 8), is preserved Least-significant byte pixel value in another passage is multiplied by 20(being moved to the left 0), is finally added the pixel value after displacement change and is somebody's turn to do The original pixel value of gray level image.As treatment in WEBGL, take out the pixel value of R or G passages and be multiplied by 2N(N is Every section of pixel moves to left digit), every section of pixel value after moving to left afterwards is added, be finally multiplied by 2 together againN, that is, obtained most Original pixel value.
The gray level image preserved by the inventive method can be directly decoded using browser Canvas and Image, and is passed through It is simple to calculate the original gradation pixel value that obtain each pixel, do not result in the loss of picture quality details.
Although embodiment of the present invention is disclosed as above, it is not restricted to listed in specification and implementation method With, it can be applied to various suitable the field of the invention completely, for those skilled in the art, can be easily Other modification is realized, therefore under the universal limited without departing substantially from claim and equivalency range, the present invention is not limited In specific details.

Claims (4)

1. a kind of store method of gray level image, it is characterised in that including:
The pixel value of the gray level image is intercepted into several sections in a certain way, be respectively stored in R, G, B or R, G, B, A it is each In individual passage.
2. the store method of gray level image according to claim 1, it is characterised in that also include:
Random value is added in some no passages.
3. a kind of method of the original pixels for obtaining the gray level image that method as described in above-mentioned any claim is preserved, its spy Levy and be, including:
Based on the mode, taken out in R, G, B or R of PNG images, the passage of G, B, A respectively from RGB the or RGBA forms Corresponding to the pixel value of each passage;
Certain digit is moved to the left by the pixel value taking-up of each passage and respectively by the pixel value, it is every after finally moving to left Section pixel value is added, and thus obtains the original pixel value of the gray level image;Or
By the pixel value of each passage take out and respectively by the pixel value to the left certain digit after, then by displacement after the picture Plain value is integrally moved to the left certain digit, thus obtains the pixel value of the most original.
4. method according to claim 3, it is characterised in that take out the pixel value of each passage and respectively by the picture Element is worth certain digit to the left, including:
The pixel value of each passage is taken out and 2 are multiplied by respectivelyN, wherein, N is that every section of pixel moves to left digit, equal to gray level image Product of the digit divided by the pixel value hop count after the business that obtains after interception hop count and every section of pixel.
CN201611122899.XA 2016-12-08 2016-12-08 The store method of gray level image and the acquisition methods of gray level image original pixels Pending CN106856001A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201611122899.XA CN106856001A (en) 2016-12-08 2016-12-08 The store method of gray level image and the acquisition methods of gray level image original pixels

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201611122899.XA CN106856001A (en) 2016-12-08 2016-12-08 The store method of gray level image and the acquisition methods of gray level image original pixels

Publications (1)

Publication Number Publication Date
CN106856001A true CN106856001A (en) 2017-06-16

Family

ID=59126067

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201611122899.XA Pending CN106856001A (en) 2016-12-08 2016-12-08 The store method of gray level image and the acquisition methods of gray level image original pixels

Country Status (1)

Country Link
CN (1) CN106856001A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
ES2774013A1 (en) * 2018-12-20 2020-07-16 Univ Nacional De Educacion A Distancia Uned METHOD AND SYSTEM TO CONVERT A DIGITAL COLOR IMAGE TO GRAY SCALE (Machine-translation by Google Translate, not legally binding)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1784886A (en) * 2003-05-08 2006-06-07 精工爱普生株式会社 Image processing for expressing gradation
CN104077746A (en) * 2013-03-29 2014-10-01 富士通株式会社 Gray level image processing method and device
CN104217416A (en) * 2013-05-31 2014-12-17 富士通株式会社 Grayscale image processing method and device

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1784886A (en) * 2003-05-08 2006-06-07 精工爱普生株式会社 Image processing for expressing gradation
CN104077746A (en) * 2013-03-29 2014-10-01 富士通株式会社 Gray level image processing method and device
CN104217416A (en) * 2013-05-31 2014-12-17 富士通株式会社 Grayscale image processing method and device

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
姬秀娟等: "《数字媒体基础及应用技术》", 31 March 2014 *
温子祺等编著: "《ARM Cortex M0微控制器深度实战》", 31 July 2014 *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
ES2774013A1 (en) * 2018-12-20 2020-07-16 Univ Nacional De Educacion A Distancia Uned METHOD AND SYSTEM TO CONVERT A DIGITAL COLOR IMAGE TO GRAY SCALE (Machine-translation by Google Translate, not legally binding)

Similar Documents

Publication Publication Date Title
Saravanan Color image to grayscale image conversion
CN102523367B (en) Real time imaging based on many palettes compresses and method of reducing
US11120725B2 (en) Method and apparatus for color gamut mapping color gradient preservation
US10453423B2 (en) Perceptually optimised color calibration method and system
EP1025558B1 (en) A method and apparatus for performing chroma key, transparency and fog operations
US6614448B1 (en) Circuit and method for displaying images using multisamples of non-uniform color resolution
JP2582999B2 (en) Color palette generation method, apparatus, data processing system, and lookup table input generation method
US10554856B2 (en) Image processing system and method
US7554557B2 (en) Device and method for image compression and decompression
US11984055B2 (en) System and method for a multi-primary wide gamut color system
DE102010055454A1 (en) Techniques for adjusting a color gamut
US11115563B2 (en) Method and apparatus for nonlinear interpolation color conversion using look up tables
CN105575314B (en) A kind of grayscale processing method, grayscale processing unit and display device
CN106228581A (en) By GPU, pixel format is converted to by ARGB the method and system of NV12
CN101766019A (en) Method from the color map in non-convex source gamut into non-convex target territory
EP3262630A1 (en) Steady color presentation manager
WO2017147548A1 (en) Method and apparatus for color-preserving spectrum reshape
US7358975B2 (en) Texture-based packing, such as for packing 8-bit pixels into one bit
US6618500B1 (en) Color conversion matrix based on minimal surface theory
CN113658564A (en) Image color depth conversion method and electronic equipment
CN106856001A (en) The store method of gray level image and the acquisition methods of gray level image original pixels
CN108540799A (en) It is a kind of can be with the compression method of difference between one video file two field pictures of Precise Representation
US20180097527A1 (en) 32-bit hdr pixel format with optimum precision
CN106709880A (en) Grayscale image saving method and grayscale image original pixel acquisition method
CN111127618A (en) Texture toning method and device during real-time rendering

Legal Events

Date Code Title Description
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20170616