CN107424136B - Method for processing Gaussian blur of picture under Mac - Google Patents
Method for processing Gaussian blur of picture under Mac Download PDFInfo
- Publication number
- CN107424136B CN107424136B CN201710637792.7A CN201710637792A CN107424136B CN 107424136 B CN107424136 B CN 107424136B CN 201710637792 A CN201710637792 A CN 201710637792A CN 107424136 B CN107424136 B CN 107424136B
- Authority
- CN
- China
- Prior art keywords
- picture
- layer
- setting
- gaussian blur
- processing
- 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.)
- Active
Links
- 238000000034 method Methods 0.000 title claims description 18
- 230000000694 effects Effects 0.000 claims abstract description 21
- 230000000873 masking effect Effects 0.000 claims abstract description 8
- 238000001914 filtration Methods 0.000 claims description 6
- 238000003672 processing method Methods 0.000 claims description 5
- 230000002093 peripheral effect Effects 0.000 description 4
- 239000003086 colorant Substances 0.000 description 3
- 238000010586 diagram Methods 0.000 description 3
- 238000009499 grossing Methods 0.000 description 2
- 108010068977 Golgi membrane glycoproteins Proteins 0.000 description 1
- 230000007547 defect Effects 0.000 description 1
- 239000005338 frosted glass Substances 0.000 description 1
- 239000005337 ground glass Substances 0.000 description 1
- 239000004973 liquid crystal related substance Substances 0.000 description 1
- 239000003973 paint Substances 0.000 description 1
- 230000009466 transformation Effects 0.000 description 1
- 238000000844 transformation Methods 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T5/00—Image enhancement or restoration
- G06T5/70—Denoising; Smoothing
Landscapes
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Image Processing (AREA)
- User Interface Of Digital Computer (AREA)
- Silver Salt Photography Or Processing Solution Therefor (AREA)
- Controls And Circuits For Display Device (AREA)
Abstract
The invention relates to a processing algorithm of Gaussian blur of a picture under Mac, which comprises the following steps: step 1, initializing and setting, at least setting the following contents: setting a bottom layer based on CALAyer; setting a CALAYER-based overlay layer for setting a masking layer and forming a masking layer effect; step 2, setting a picture in the bottom layer; step 3, modifying parameters of the coverage layer; step 4, overlapping and displaying an overlay layer on the bottom layer; step 5, capturing the clicking operation of the mouse, and performing first processing when the picture in the step 2 is clicked by the mouse to enable the picture in the bottom layer picture layer to be normally displayed; and 6, when the mouse clicks the picture in the step 2 again, performing secondary processing to enable the picture in the bottom layer to display Gaussian blur. The invention can set the Gaussian blur degree of the picture as required and set the image processing effect related to the Gaussian blur based on CALAyer and CIFilter, and has convenient use and good user experience.
Description
Technical Field
The invention relates to the technical field of image (graph) display, in particular to a processing method of picture Gaussian blur under Mac. Mac refers to the apple computer (once translated to the Macintosh transliteration), running the OS X system (a proprietary operating system developed by apple for the Macintosh computer).
Background
In the process of image processing, Gaussian Blur (english: Gaussian Blur) is a more commonly used Blur algorithm, also called Gaussian smoothing, is a processing effect widely used in image processing software such as Adobe Photoshop, GIMP, and paint.
By "blurred" it is understood that each pixel is averaged over surrounding pixels. For example:
if the middle point (middle pixel point) is 2 and the peripheral 8 peripheral points (peripheral pixel points) are 1, then: the "middle point" is the average of the "peripheral points" and becomes 1.
Numerically, this is a kind of "smoothing". Graphically, it is equivalent to producing a "blur" effect, with the "middle point" losing detail. The larger the blur radius, the more blurred the image, and from a numerical perspective, the smoother the value.
In the OS X system, a gaussian semi-transparent View control nsvisual effect View has been provided, but the control only supports limited colors, and it is difficult to change colors, so that it is inconvenient to implement gaussian blur display of a picture with the control, and it is also impossible to implement switching from a gaussian picture to a normal picture display.
Disclosure of Invention
Aiming at the defects in the prior art, the invention aims to provide a processing method of picture Gaussian blur under Mac, which is based on CALAyer and CIFilter, can set the Gaussian blur degree of the picture as required, can set the image processing effect related to the Gaussian blur, and has convenient use and good user experience.
In order to achieve the purpose, the invention adopts the technical scheme that:
a processing method of picture Gaussian blur under Mac is characterized by comprising the following steps:
step 1, initializing and setting, at least setting the following contents:
setting a bottom layer based on CALAyer for displaying an original picture;
setting a CALAYER-based overlay layer for setting a mask layer and forming a mask layer effect, and viewing a picture through the mask layer to generate Gaussian blur;
step 2, setting a picture in the bottom layer;
step 3, modifying parameters of the coverage layer;
step 4, overlapping and displaying an overlay layer on the bottom layer;
step 5, capturing the clicking operation of the mouse, and performing first processing when the picture in the step 2 is clicked by the mouse to enable the picture in the bottom layer picture layer to be normally displayed;
and 6, when the mouse clicks the picture in the step 2 again, performing secondary processing to enable the picture in the bottom layer to display Gaussian blur.
On the basis of the above technical solution, step 1 further includes setting the following contents:
setting a picture class NSView for displaying pictures;
setting a filter CIFilter for setting parameters of an overlay layer, wherein the parameters include but are not limited to: transmitting and filtering.
On the basis of the technical scheme, the size of the bottom layer image layer is equal to that of the original image.
On the basis of the above technical solution, step 3 specifically includes:
setting a relevant value of a background filters parameter of an overlay layer, wherein the relevant value at least comprises the following values:
sinputSaturation value of CIColorControl,
the inputRadius value of CIGaussianBlur,
and setting the color of the background parameter of the coverage layer.
On the basis of the technical scheme, the step 5 specifically comprises the following steps:
sequentially changing backsourcendfilters values of the coverage layer by 1000 times, and:
wait 100 microseconds after each change,
and when the numerical value is changed, the background parameter color of the overlay layer is set to be transparent, so that the picture in the bottom layer is normally displayed.
On the basis of the above technical solution, step 6 specifically includes:
sequentially changing backsourcendfilters values of the coverage layer by 1000 times, and:
Wait 100 microseconds after each change,
the background color is set.
On the basis of the technical scheme, the method further comprises the step of setting an image processing effect related to the Gaussian blur, and the method specifically comprises but is not limited to the following steps: blurring, filtering, ghosting, and the like.
On the basis of the technical scheme, the specific mode for setting the image processing effect related to the Gaussian blur is as follows:
when the picture is normally displayed, a layer is covered on the picture, and the covered layer is subjected to masking processing.
The processing method of the picture Gaussian blur under Mac is based on CALAyer and CIFilter, can set the Gaussian blur degree of the picture as required, can set the image processing effect related to the Gaussian blur, and is convenient to use and good in user experience.
Drawings
The invention has the following drawings:
FIG. 1 is a block flow diagram of the present invention.
Fig. 2 is a schematic diagram of an original picture.
FIG. 3 is a schematic diagram of Gaussian blur effect.
Detailed Description
The present invention will be described in further detail with reference to the accompanying drawings.
As shown in fig. 1, the method for processing gaussian blur of a picture under Mac according to the present invention includes the following steps:
step 1, initializing and setting, specifically comprising:
setting a bottom layer based on CALAyer for displaying an original picture;
Setting a CALAYER-based overlay layer for setting a mask layer and forming a mask layer effect, and viewing a picture through the mask layer to generate Gaussian blur;
setting a picture class NSView for displaying pictures;
setting a filter CIFilter for setting parameters of an overlay layer, wherein the parameters include but are not limited to: transmitting and filtering light;
step 2, setting a picture in the bottom layer, wherein the picture is an original picture to be subjected to Gaussian blur;
the setting refers to adding an original picture into a bottom layer, and preferably, the adding is centered and aligned;
the size of the bottom layer is equal to that of the original picture;
the size of the covering layer is equal to that of the bottom layer;
step 3, modifying the parameters of the overlay layer, specifically comprising:
setting a relevant value of a background filters parameter of an overlay layer, wherein the relevant value at least comprises the following values:
sinputSaturation value of CIColorControl,
the inputRadius value of CIGaussianBlur,
setting the color of background parameters of the coverage layer, wherein the setting principle of the color is as follows: the color is a default color of black and,
CIColorControl and CIGaussianBlur are the names of CIFilter, and setting CIColorControl and CIGaussianBlur is equal to setting CIFilter;
Step 4, overlapping and displaying an overlay layer on the bottom layer;
for example: the layer which is arranged on backsourcedFilters is placed on the bottom layer;
and 5, capturing the clicking operation of the mouse, and when the mouse clicks the picture in the step 2, performing the following processing:
sequentially changing backsourcendfilters values of the coverage layer by 1000 times, and:
wait 100 microseconds (us) after each change,
while changing the numerical value, setting the color of background parameter of the overlay layer to be transparent, so that the picture in the bottom layer is normally displayed;
the changing times are used for controlling the fineness degree of the change of the picture;
the waiting time is used for controlling the speed of the change speed;
specifically speaking:
changing the background filters values of the overlay layers in sequence means that:
sinputsaturration value of CIColorControl, from 0 to 2.5 in 1000 transformations;
the inputladius value of CIGaussianBlur is transformed from 0 to 20 for 1000 times;
further, in the case of a liquid crystal display,
the sinputSaturation value of CIColorControl is 2.5 as default, and can be set to a numerical value larger than 2.5, so that the Gaussian blur effect is more obvious;
the inputladius value of the CIGaussianBlur is default to 20, and can be set to a value larger than 20 or a value smaller than 20;
and 6, when the mouse clicks the picture in the step 2 again, performing the following processing:
Sequentially changing backsourcendfilters values of the coverage layer by 1000 times, and:
wait 100 microseconds (us) after each change,
setting a background color (picture display gaussian blur);
specifically speaking:
the mode of judging the mouse to click again is as follows: enabling the thread to be dormant (sleep) for 100 mu s through a separately opened thread, and judging that the mouse clicks again if mouse clicking operation exists in the period;
setting the background color means: the set color defaults to black, i.e., each RBG value is 0.
In the invention, Gaussian blur can be realized by setting backstreamfilters.
The effect of the pictures before and after gaussian blur can be seen in fig. 2 and 3.
On the basis of the technical scheme, the method further comprises the step of setting an image processing effect related to the Gaussian blur, and the method specifically comprises but is not limited to the following steps: blurring, filtering, ghosting, and the like.
For example:
when the picture is normally displayed, a layer is covered on the picture, the covered layer is subjected to masking treatment,
the masking process includes, but is not limited to: the effect of the ground glass is that,
further, by setting the parameters of the masking process, the degree of masking process (frosted glass effect) is adjusted.
On the basis of the above technical solution, in step 6, changing a background filters value of the overlay layer to adjust a degree of gaussian blur, where the degree of gaussian blur includes, but is not limited to: and (4) semi-permeable.
On the basis of the above technical solution, in step 6, the background colors include, but are not limited to: default white, system blurs display.
Those not described in detail in this specification are well within the skill of the art.
Claims (5)
1. A processing method of picture Gaussian blur under Mac is characterized by comprising the following steps:
step 1, initializing and setting, at least setting the following contents:
setting a bottom layer based on CALAyer for displaying pictures;
setting a CALAYER-based overlay layer for setting a mask layer and forming a mask layer effect, and viewing a picture through the mask layer to generate Gaussian blur;
setting a picture class NSView for displaying pictures;
setting a filter CIFilter for setting parameters of an overlay layer, wherein the parameters include but are not limited to: transmitting and filtering light;
step 2, setting a picture in the bottom layer;
step 3, modifying parameters of the coverage layer;
step 4, overlapping and displaying an overlay layer on the bottom layer;
step 5, capturing the clicking operation of the mouse, and performing first processing when the picture in the step 2 is clicked by the mouse to enable the picture in the bottom layer picture layer to be normally displayed; the method specifically comprises the following steps:
Sequentially changing backsourcendfilters values of the coverage layer by 1000 times, and:
wait 100 microseconds after each change,
while changing the numerical value, setting the color of background parameter of the overlay layer to be transparent, so that the picture in the bottom layer is normally displayed;
step 6, when the mouse clicks the picture in the step 2 again, performing second processing to enable the picture in the bottom layer to display Gaussian blur; the method specifically comprises the following steps:
sequentially changing backsourcendfilters values of the coverage layer by 1000 times, and:
wait 100 microseconds after each change,
the background color is set.
2. The method for processing the Gaussian blur of the picture under Mac according to claim 1, characterized in that: and the size of the bottom layer is equal to the size of the picture.
3. The method for processing the Gaussian blur of the picture under Mac according to claim 1, characterized in that: in step 3, the method specifically comprises the following steps:
setting a relevant value of a background filters parameter of an overlay layer, wherein the relevant value at least comprises the following values:
sinputSaturation value of CIColorControl,
the inputRadius value of CIGaussianBlur,
and setting the color of the background parameter of the coverage layer.
4. The method for processing the Gaussian blur of the picture under Mac according to claim 1, characterized in that: further comprising setting image processing effects related to gaussian blur, including but not limited to: blurring, filtering, ghosting effects.
5. The method for processing the picture under Mac with gaussian blur according to claim 4, characterized in that: the specific way to set the image processing effect related to gaussian blur is as follows:
when the picture is normally displayed, a layer is covered on the picture, and the covered layer is subjected to masking processing.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710637792.7A CN107424136B (en) | 2017-07-31 | 2017-07-31 | Method for processing Gaussian blur of picture under Mac |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710637792.7A CN107424136B (en) | 2017-07-31 | 2017-07-31 | Method for processing Gaussian blur of picture under Mac |
Publications (2)
Publication Number | Publication Date |
---|---|
CN107424136A CN107424136A (en) | 2017-12-01 |
CN107424136B true CN107424136B (en) | 2022-06-28 |
Family
ID=60431657
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201710637792.7A Active CN107424136B (en) | 2017-07-31 | 2017-07-31 | Method for processing Gaussian blur of picture under Mac |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN107424136B (en) |
Families Citing this family (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108268871A (en) * | 2018-02-01 | 2018-07-10 | 武汉大学 | A kind of licence plate recognition method end to end and system based on convolutional neural networks |
CN111104935B (en) * | 2019-11-08 | 2021-10-12 | 浙江口碑网络技术有限公司 | Image acquisition method, image display method, device and equipment |
CN112182415B (en) * | 2020-09-04 | 2021-08-17 | 上海松鼠课堂人工智能科技有限公司 | Intelligent learning guiding method and system |
Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106484242A (en) * | 2016-09-19 | 2017-03-08 | 北京京东尚科信息技术有限公司 | The method for information display at interface and device |
Family Cites Families (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2014059766A (en) * | 2012-09-18 | 2014-04-03 | Sharp Corp | Image processing apparatus, image forming apparatus, program, and recording medium |
CN104301628A (en) * | 2014-09-30 | 2015-01-21 | 北京金山安全软件有限公司 | Method and device for carrying out dynamic blurring on image and electronic equipment |
CN104657956B (en) * | 2015-03-16 | 2018-10-02 | 龙旗电子(惠州)有限公司 | A method of realizing smart mobile phone picture beautifying functions |
CN105701784A (en) * | 2016-02-14 | 2016-06-22 | 华浩博达(北京)科技股份有限公司 | Image processing method capable of real time visualization |
CN105825490A (en) * | 2016-03-16 | 2016-08-03 | 北京小米移动软件有限公司 | Gaussian blur method and device of image |
CN106339983A (en) * | 2016-08-17 | 2017-01-18 | 乐视控股(北京)有限公司 | Blurring animation realization method through Gaussian blurring and blurring animation realization device thereof |
CN106651991B (en) * | 2016-09-12 | 2023-10-31 | 广州久邦世纪科技有限公司 | Intelligent mapping realization method and system thereof |
-
2017
- 2017-07-31 CN CN201710637792.7A patent/CN107424136B/en active Active
Patent Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106484242A (en) * | 2016-09-19 | 2017-03-08 | 北京京东尚科信息技术有限公司 | The method for information display at interface and device |
Also Published As
Publication number | Publication date |
---|---|
CN107424136A (en) | 2017-12-01 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN107424136B (en) | Method for processing Gaussian blur of picture under Mac | |
CN106971165B (en) | A kind of implementation method and device of filter | |
CN109658877B (en) | Display device, driving method thereof and electronic equipment | |
CN107170424B (en) | Display control method, display method and electronic equipment | |
JP2003271125A (en) | Device, method and program for image display | |
CN109036245A (en) | A kind of method, apparatus, integrated circuit and the computer storage medium of display processing | |
US20140139547A1 (en) | Adjusting Color Attribute of an Image in a Non-Uniform Way | |
CN108230255A (en) | It is used to implement the method, apparatus and electronic equipment of image enhancement | |
CN108156533B (en) | Smart television backlight adjusting method, smart television and storage medium | |
CN104103043B (en) | Spatial gamut mapping method | |
WO2016095317A1 (en) | Liquid crystal display panel and driving method therefor | |
US10416482B2 (en) | Display brightness adjustment method | |
CN107993604A (en) | Display screen adjusting method and device | |
CN107766038B (en) | Method for carrying out contour clipping and beautifying on UI control based on Android system | |
JP2008047950A (en) | Unit, method, and program for processing image | |
CN1957603A (en) | Video signal transformation device, and video display device | |
US10650507B2 (en) | Image display method and apparatus in VR device, and VR device | |
US20150248221A1 (en) | Image processing device, image processing method, image processing system, and non-transitory computer readable medium | |
CN107358578B (en) | Yin-yang face treatment method and device | |
CN104299195B (en) | A kind of image defogging method based on auto-adaptive doublethreshold and dark channel prior | |
CN107133932A (en) | Retina image preprocessing method and device and computing equipment | |
CN106504713A (en) | Television set dyschromatopsia mode tuning system and method | |
CN105513566A (en) | Image adjusting method of executing optimal adjustment according to different environments and displayer | |
CN109302629A (en) | A kind of method and display terminal for for picture switching picture frame | |
CN101727852A (en) | Image processing method and device |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |