Want to join? Log In or Join Now in seconds. English (United States)

CREATE A NEW ACCOUNT

{{registerModel.Error}}

Log In

/content/images/forum.png

Feedbacks

Get help from the knowledgeable Reddah Community and official Reddah Support!
/content/images/ambassador.png

Discuss on AD

A place for discussing the ads that reddah is currently running.
/content/images/contact_us.png

Contact Us

Get in touch with an Reddah Support technician. We are ready and willing to help you!
26
picture

UK lawmakers: Facebook 'intentionally and knowingly' violated data privacy laws

UK lawmakers have accused Facebook of violating data privacy and competition laws in a report on social media disinformation that also says CEO Mark Zuckerberg showed "contempt" toward parliament
world,facebook submitted 6 years ago ago by b8c40ad899c64f9a88cfca87d90e5c34
picture

UK lawmakers have accused Facebook of violating data privacy and competition laws in a report on social media disinformation that also says CEO Mark Zuckerberg showed "contempt" toward parliament by not appearing before them.

The UK Digital, Culture, Media and Sport Committee said in a report published Monday that a trove of internal Facebook emails it reviewed demonstrated that the social media platform had "intentionally and knowingly" violated both data privacy and competition laws.

According to the committee, the documents show that Facebook was "willing to override its users' privacy settings in order to transfer data" to app developers. The lawmakers also claim the documents show the social network was able to "starve" some developers of data and force them out of business.

"Companies like Facebook should not be allowed to behave like 'digital gangsters' in the online world, considering themselves to be ahead of and beyond the law," the report said.

In response to the report, Facebook said it had not breached data protection or competition laws. Karim Palant, Facebook's UK public policy manager, said in a statement that the company "supports effective privacy legislation" and is also open to "meaningful regulation."

Overhaul needed

While Facebook was a major focus of the report, the Digital, Culture, Media and Sport Committee made several recommendations on how to combat fake news and disinformation.

The committee said:

  • Social media platforms should be subject to a compulsory code of ethics.
  • An independent UK regulator should monitor tech companies, and be able to launch legal proceedings against them.
  • UK antitrust regulators should conduct a "comprehensive audit" of the advertising market on social media.
  • UK regulators should investigate whether Facebook has been involved in anti-competitive practices.
  • The government should examine recent elections for evidence of voter manipulation.

The committee's investigation lasted 18 months and featured nearly two dozen oral evidence sessions, including a special hearing in Washington, D.C. and an "international grand committee" attended by representatives of nine countries. The final report ran to over 100 pages.

"The big tech companies must not be allowed to expand exponentially, without constraint or proper regulatory oversight," the report stated. "Only governments and the law are powerful enough to contain them."

Target: Facebook

The report harshly criticized Facebook and Zuckerberg, who repeatedly refused to appear before the committee last year despite numerous requests.

"The management structure of Facebook is opaque to those outside the business and this seemed to be designed to conceal knowledge of and responsibility for specific decisions," the report said. "Facebook used the strategy of sending witnesses who they said were the most appropriate representatives, yet had not been properly briefed on crucial issues, and could not or chose not to answer many of our questions."

The report's authors said they had "no doubt that this strategy was deliberate."

Facebook's response

Palant, the Facebook public policy manager, said that the company shares the committee's "concerns about false news and election integrity" and that it had made "a significant contribution to their investigation" by answering more than 700 questions.

Palant also highlighted the "substantial changes" to political advertising standards the company has undertaken.

"No other channel for political advertising is as transparent and offers the tools that we do," said Palant. "We have tripled the size of the team working to detect and protect users from bad content to 30,000 people and invested heavily in machine learning, artificial intelligence and computer vision technology to help prevent this type of abuse."

29

var canvas = document.getElementById("canvas"), ctx = canvas.getContext("2d"), img = new Image(), effectEl = document.getElementById("effect"), settings = { radius: 4, intensity: 25, ApplyFilter: function() { doOilPaintEffect(); } } img.addEventListener('load', function() { // reduced the size by half for pen and performance. canvas.width = (this.width / 2); canvas.height = (this.height / 2); ctx.drawImage(this, 0, 0, canvas.width, canvas.height); doOilPaintEffect(); }); img.crossOrigin = "Anonymous"; img.src = "https://wow.techbrood.com/uploads/161001/normal2.jpg"; //var gui = new dat.GUI(); //gui.add(settings, 'intensity'); //gui.add(settings, 'radius'); //gui.add(settings, 'ApplyFilter'); function doOilPaintEffect() { oilPaintEffect(canvas, settings.radius, settings.intensity); } function oilPaintEffect(canvas, radius, intensity) { var width = canvas.width, height = canvas.height, imgData = ctx.getImageData(0, 0, width, height), pixData = imgData.data, // change to createElement getting added element just for the demo destCanvas = document.getElementById("dest-canvas"), dCtx = destCanvas.getContext("2d"), pixelIntensityCount = []; destCanvas.width = width; destCanvas.height = height; var destImageData = dCtx.createImageData(width, height), destPixData = destImageData.data, intensityLUT = [], rgbLUT = []; for (var y = 0; y < height; y++) { intensityLUT[y] = []; rgbLUT[y] = []; for (var x = 0; x < width; x++) { var idx = (y * width + x) * 4, r = pixData[idx], g = pixData[idx + 1], b = pixData[idx + 2], avg = (r + g + b) / 3; intensityLUT[y][x] = Math.round((avg * intensity) / 255); rgbLUT[y][x] = { r: r, g: g, b: b }; } } for (y = 0; y < height; y++) { for (x = 0; x < width; x++) { pixelIntensityCount = []; // Find intensities of nearest pixels within radius. for (var yy = -radius; yy <= radius; yy++) { for (var xx = -radius; xx <= radius; xx++) { if (y + yy > 0 && y + yy < height && x + xx > 0 && x + xx < width) { var intensityVal = intensityLUT[y + yy][x + xx]; if (!pixelIntensityCount[intensityVal]) { pixelIntensityCount[intensityVal] = { val: 1, r: rgbLUT[y + yy][x + xx].r, g: rgbLUT[y + yy][x + xx].g, b: rgbLUT[y + yy][x + xx].b } } else { pixelIntensityCount[intensityVal].val++; pixelIntensityCount[intensityVal].r += rgbLUT[y + yy][x + xx].r; pixelIntensityCount[intensityVal].g += rgbLUT[y + yy][x + xx].g; pixelIntensityCount[intensityVal].b += rgbLUT[y + yy][x + xx].b; } } } } pixelIntensityCount.sort(function(a, b) { return b.val - a.val; }); var curMax = pixelIntensityCount[0].val, dIdx = (y * width + x) * 4; destPixData[dIdx] = ~~(pixelIntensityCount[0].r / curMax); destPixData[dIdx + 1] = ~~(pixelIntensityCount[0].g / curMax); destPixData[dIdx + 2] = ~~(pixelIntensityCount[0].b / curMax); destPixData[dIdx + 3] = 255; } } // change this to ctx to instead put the data on the original canvas dCtx.putImageData(destImageData, 0, 0); } window["reddahApi"].loadCompleted()

body { text-align: center; background: #ececec; font-family: Tahoma, Geneva, sans-serif } section { display: inline-block } canvas { border: 1px solid #000 }
submitted 5 years ago ago by 1b54d14be50240948fc53b199a461f52
picture

Original

仿PS油画滤镜特效

30

v1.0

.test{}
submitted 6 years ago ago by 877285a6b9fb4b5cbe9dd43d11700177
picture
Quickstart for MSAL JS

Welcome to MSAL.js Quickstart





    

31

v1.0

.test{}
submitted 6 years ago ago by 877285a6b9fb4b5cbe9dd43d11700177
picture
Quickstart for MSAL JS

Welcome to MSAL.js Quickstart





    

32
33

var canvas = document.getElementById("canvas"), ctx = canvas.getContext("2d"), img = new Image(), effectEl = document.getElementById("effect"), settings = { radius: 4, intensity: 25, ApplyFilter: function() { doOilPaintEffect(); } } img.addEventListener('load', function() { // reduced the size by half for pen and performance. canvas.width = (this.width / 2); canvas.height = (this.height / 2); ctx.drawImage(this, 0, 0, canvas.width, canvas.height); doOilPaintEffect(); }); img.crossOrigin = "Anonymous"; img.src = "https://login.reddah.com/uploadPhoto/5a28b388b6db4efea5656f2670acd937_reddah_preview.jpg"; //"https://wow.techbrood.com/uploads/161001/normal2.jpg"; //var gui = new dat.GUI(); //gui.add(settings, 'intensity'); //gui.add(settings, 'radius'); //gui.add(settings, 'ApplyFilter'); function doOilPaintEffect() { oilPaintEffect(canvas, settings.radius, settings.intensity); } function oilPaintEffect(canvas, radius, intensity) { var width = canvas.width, height = canvas.height, imgData = ctx.getImageData(0, 0, width, height), pixData = imgData.data, // change to createElement getting added element just for the demo destCanvas = document.getElementById("dest-canvas"), dCtx = destCanvas.getContext("2d"), pixelIntensityCount = []; destCanvas.width = width; destCanvas.height = height; var destImageData = dCtx.createImageData(width, height), destPixData = destImageData.data, intensityLUT = [], rgbLUT = []; for (var y = 0; y < height; y++) { intensityLUT[y] = []; rgbLUT[y] = []; for (var x = 0; x < width; x++) { var idx = (y * width + x) * 4, r = pixData[idx], g = pixData[idx + 1], b = pixData[idx + 2], avg = (r + g + b) / 3; intensityLUT[y][x] = Math.round((avg * intensity) / 255); rgbLUT[y][x] = { r: r, g: g, b: b }; } } for (y = 0; y < height; y++) { for (x = 0; x < width; x++) { pixelIntensityCount = []; // Find intensities of nearest pixels within radius. for (var yy = -radius; yy <= radius; yy++) { for (var xx = -radius; xx <= radius; xx++) { if (y + yy > 0 && y + yy < height && x + xx > 0 && x + xx < width) { var intensityVal = intensityLUT[y + yy][x + xx]; if (!pixelIntensityCount[intensityVal]) { pixelIntensityCount[intensityVal] = { val: 1, r: rgbLUT[y + yy][x + xx].r, g: rgbLUT[y + yy][x + xx].g, b: rgbLUT[y + yy][x + xx].b } } else { pixelIntensityCount[intensityVal].val++; pixelIntensityCount[intensityVal].r += rgbLUT[y + yy][x + xx].r; pixelIntensityCount[intensityVal].g += rgbLUT[y + yy][x + xx].g; pixelIntensityCount[intensityVal].b += rgbLUT[y + yy][x + xx].b; } } } } pixelIntensityCount.sort(function(a, b) { return b.val - a.val; }); var curMax = pixelIntensityCount[0].val, dIdx = (y * width + x) * 4; destPixData[dIdx] = ~~(pixelIntensityCount[0].r / curMax); destPixData[dIdx + 1] = ~~(pixelIntensityCount[0].g / curMax); destPixData[dIdx + 2] = ~~(pixelIntensityCount[0].b / curMax); destPixData[dIdx + 3] = 255; } } // change this to ctx to instead put the data on the original canvas dCtx.putImageData(destImageData, 0, 0); } window["reddahApi"].loadCompleted()

body { text-align: center; background: #ececec; font-family: Tahoma, Geneva, sans-serif } section { display: inline-block } canvas { border: 1px solid #000 }
submitted 5 years ago ago by 1b54d14be50240948fc53b199a461f52
picture

Original

仿PS油画滤镜特效

35

var canvas = document.getElementById("canvas"), ctx = canvas.getContext("2d"), img = new Image(), effectEl = document.getElementById("effect"), settings = { radius: 4, intensity: 25, ApplyFilter: function() { doOilPaintEffect(); } } img.addEventListener('load', function() { // reduced the size by half for pen and performance. canvas.width = (this.width / 2); canvas.height = (this.height / 2); ctx.drawImage(this, 0, 0, canvas.width, canvas.height); doOilPaintEffect(); }); img.crossOrigin = "Anonymous"; img.src = "https://login.reddah.com/uploadPhoto/5a28b388b6db4efea5656f2670acd937_reddah_preview.jpg"; //"https://wow.techbrood.com/uploads/161001/normal2.jpg"; //var gui = new dat.GUI(); //gui.add(settings, 'intensity'); //gui.add(settings, 'radius'); //gui.add(settings, 'ApplyFilter'); function doOilPaintEffect() { oilPaintEffect(canvas, settings.radius, settings.intensity); } function oilPaintEffect(canvas, radius, intensity) { var width = canvas.width, height = canvas.height, imgData = ctx.getImageData(0, 0, width, height), pixData = imgData.data, // change to createElement getting added element just for the demo destCanvas = document.getElementById("dest-canvas"), dCtx = destCanvas.getContext("2d"), pixelIntensityCount = []; destCanvas.width = width; destCanvas.height = height; var destImageData = dCtx.createImageData(width, height), destPixData = destImageData.data, intensityLUT = [], rgbLUT = []; for (var y = 0; y < height; y++) { intensityLUT[y] = []; rgbLUT[y] = []; for (var x = 0; x < width; x++) { var idx = (y * width + x) * 4, r = pixData[idx], g = pixData[idx + 1], b = pixData[idx + 2], avg = (r + g + b) / 3; intensityLUT[y][x] = Math.round((avg * intensity) / 255); rgbLUT[y][x] = { r: r, g: g, b: b }; } } for (y = 0; y < height; y++) { for (x = 0; x < width; x++) { pixelIntensityCount = []; // Find intensities of nearest pixels within radius. for (var yy = -radius; yy <= radius; yy++) { for (var xx = -radius; xx <= radius; xx++) { if (y + yy > 0 && y + yy < height && x + xx > 0 && x + xx < width) { var intensityVal = intensityLUT[y + yy][x + xx]; if (!pixelIntensityCount[intensityVal]) { pixelIntensityCount[intensityVal] = { val: 1, r: rgbLUT[y + yy][x + xx].r, g: rgbLUT[y + yy][x + xx].g, b: rgbLUT[y + yy][x + xx].b } } else { pixelIntensityCount[intensityVal].val++; pixelIntensityCount[intensityVal].r += rgbLUT[y + yy][x + xx].r; pixelIntensityCount[intensityVal].g += rgbLUT[y + yy][x + xx].g; pixelIntensityCount[intensityVal].b += rgbLUT[y + yy][x + xx].b; } } } } pixelIntensityCount.sort(function(a, b) { return b.val - a.val; }); var curMax = pixelIntensityCount[0].val, dIdx = (y * width + x) * 4; destPixData[dIdx] = ~~(pixelIntensityCount[0].r / curMax); destPixData[dIdx + 1] = ~~(pixelIntensityCount[0].g / curMax); destPixData[dIdx + 2] = ~~(pixelIntensityCount[0].b / curMax); destPixData[dIdx + 3] = 255; } } // change this to ctx to instead put the data on the original canvas dCtx.putImageData(destImageData, 0, 0); } window["reddahApi"].loadCompleted()

body { text-align: center; background: #ececec; font-family: Tahoma, Geneva, sans-serif } section { display: inline-block } canvas { border: 1px solid #000 }
submitted 5 years ago ago by 1b54d14be50240948fc53b199a461f52
picture

Original

仿PS油画滤镜特效

37

var canvas = document.getElementById("canvas"), ctx = canvas.getContext("2d"), img = new Image(), effectEl = document.getElementById("effect"), settings = { radius: 4, intensity: 25, ApplyFilter: function() { doOilPaintEffect(); } } img.addEventListener('load', function() { // reduced the size by half for pen and performance. canvas.width = (this.width / 2); canvas.height = (this.height / 2); ctx.drawImage(this, 0, 0, canvas.width, canvas.height); doOilPaintEffect(); }); function choosePhoto(){ alert(1) window["reddahApi"].album().then(data=>{ alert(data) }) } img.crossOrigin = "Anonymous"; img.src = "assets/500/501.jpeg"; //"https://wow.techbrood.com/uploads/161001/normal2.jpg"; //var gui = new dat.GUI(); //gui.add(settings, 'intensity'); //gui.add(settings, 'radius'); //gui.add(settings, 'ApplyFilter'); function doOilPaintEffect() { oilPaintEffect(canvas, settings.radius, settings.intensity); } function oilPaintEffect(canvas, radius, intensity) { var width = canvas.width, height = canvas.height, imgData = ctx.getImageData(0, 0, width, height), pixData = imgData.data, // change to createElement getting added element just for the demo destCanvas = document.getElementById("dest-canvas"), dCtx = destCanvas.getContext("2d"), pixelIntensityCount = []; destCanvas.width = width; destCanvas.height = height; var destImageData = dCtx.createImageData(width, height), destPixData = destImageData.data, intensityLUT = [], rgbLUT = []; for (var y = 0; y < height; y++) { intensityLUT[y] = []; rgbLUT[y] = []; for (var x = 0; x < width; x++) { var idx = (y * width + x) * 4, r = pixData[idx], g = pixData[idx + 1], b = pixData[idx + 2], avg = (r + g + b) / 3; intensityLUT[y][x] = Math.round((avg * intensity) / 255); rgbLUT[y][x] = { r: r, g: g, b: b }; } } for (y = 0; y < height; y++) { for (x = 0; x < width; x++) { pixelIntensityCount = []; // Find intensities of nearest pixels within radius. for (var yy = -radius; yy <= radius; yy++) { for (var xx = -radius; xx <= radius; xx++) { if (y + yy > 0 && y + yy < height && x + xx > 0 && x + xx < width) { var intensityVal = intensityLUT[y + yy][x + xx]; if (!pixelIntensityCount[intensityVal]) { pixelIntensityCount[intensityVal] = { val: 1, r: rgbLUT[y + yy][x + xx].r, g: rgbLUT[y + yy][x + xx].g, b: rgbLUT[y + yy][x + xx].b } } else { pixelIntensityCount[intensityVal].val++; pixelIntensityCount[intensityVal].r += rgbLUT[y + yy][x + xx].r; pixelIntensityCount[intensityVal].g += rgbLUT[y + yy][x + xx].g; pixelIntensityCount[intensityVal].b += rgbLUT[y + yy][x + xx].b; } } } } pixelIntensityCount.sort(function(a, b) { return b.val - a.val; }); var curMax = pixelIntensityCount[0].val, dIdx = (y * width + x) * 4; destPixData[dIdx] = ~~(pixelIntensityCount[0].r / curMax); destPixData[dIdx + 1] = ~~(pixelIntensityCount[0].g / curMax); destPixData[dIdx + 2] = ~~(pixelIntensityCount[0].b / curMax); destPixData[dIdx + 3] = 255; } } // change this to ctx to instead put the data on the original canvas dCtx.putImageData(destImageData, 0, 0); } window["reddahApi"].loadCompleted()

body { text-align: center; background: #ececec; font-family: Tahoma, Geneva, sans-serif } section { display: inline-block } canvas { border: 1px solid #000 }
submitted 5 years ago ago by 1b54d14be50240948fc53b199a461f52
picture

Original

仿PS油画滤镜特效


38

var canvas = document.getElementById("canvas"), ctx = canvas.getContext("2d"), img = new Image(), effectEl = document.getElementById("effect"), settings = { radius: 4, intensity: 25, ApplyFilter: function() { doOilPaintEffect(); } } img.addEventListener('load', function() { // reduced the size by half for pen and performance. canvas.width = (this.width / 2); canvas.height = (this.height / 2); ctx.drawImage(this, 0, 0, canvas.width, canvas.height); doOilPaintEffect(); }); function choosePhoto(){ alert(1) window["reddahApi"].album().then(data=>{ alert(data) img.src=data; }) } img.crossOrigin = "Anonymous"; img.src = "assets/500/501.jpeg"; //"https://wow.techbrood.com/uploads/161001/normal2.jpg"; //var gui = new dat.GUI(); //gui.add(settings, 'intensity'); //gui.add(settings, 'radius'); //gui.add(settings, 'ApplyFilter'); function doOilPaintEffect() { oilPaintEffect(canvas, settings.radius, settings.intensity); } function oilPaintEffect(canvas, radius, intensity) { var width = canvas.width, height = canvas.height, imgData = ctx.getImageData(0, 0, width, height), pixData = imgData.data, // change to createElement getting added element just for the demo destCanvas = document.getElementById("dest-canvas"), dCtx = destCanvas.getContext("2d"), pixelIntensityCount = []; destCanvas.width = width; destCanvas.height = height; var destImageData = dCtx.createImageData(width, height), destPixData = destImageData.data, intensityLUT = [], rgbLUT = []; for (var y = 0; y < height; y++) { intensityLUT[y] = []; rgbLUT[y] = []; for (var x = 0; x < width; x++) { var idx = (y * width + x) * 4, r = pixData[idx], g = pixData[idx + 1], b = pixData[idx + 2], avg = (r + g + b) / 3; intensityLUT[y][x] = Math.round((avg * intensity) / 255); rgbLUT[y][x] = { r: r, g: g, b: b }; } } for (y = 0; y < height; y++) { for (x = 0; x < width; x++) { pixelIntensityCount = []; // Find intensities of nearest pixels within radius. for (var yy = -radius; yy <= radius; yy++) { for (var xx = -radius; xx <= radius; xx++) { if (y + yy > 0 && y + yy < height && x + xx > 0 && x + xx < width) { var intensityVal = intensityLUT[y + yy][x + xx]; if (!pixelIntensityCount[intensityVal]) { pixelIntensityCount[intensityVal] = { val: 1, r: rgbLUT[y + yy][x + xx].r, g: rgbLUT[y + yy][x + xx].g, b: rgbLUT[y + yy][x + xx].b } } else { pixelIntensityCount[intensityVal].val++; pixelIntensityCount[intensityVal].r += rgbLUT[y + yy][x + xx].r; pixelIntensityCount[intensityVal].g += rgbLUT[y + yy][x + xx].g; pixelIntensityCount[intensityVal].b += rgbLUT[y + yy][x + xx].b; } } } } pixelIntensityCount.sort(function(a, b) { return b.val - a.val; }); var curMax = pixelIntensityCount[0].val, dIdx = (y * width + x) * 4; destPixData[dIdx] = ~~(pixelIntensityCount[0].r / curMax); destPixData[dIdx + 1] = ~~(pixelIntensityCount[0].g / curMax); destPixData[dIdx + 2] = ~~(pixelIntensityCount[0].b / curMax); destPixData[dIdx + 3] = 255; } } // change this to ctx to instead put the data on the original canvas dCtx.putImageData(destImageData, 0, 0); } window["reddahApi"].loadCompleted()

body { text-align: center; background: #ececec; font-family: Tahoma, Geneva, sans-serif } section { display: inline-block } canvas { border: 1px solid #000 }
submitted 5 years ago ago by 1b54d14be50240948fc53b199a461f52
picture

Original

仿PS油画滤镜特效


39

var canvas = document.getElementById("canvas"), ctx = canvas.getContext("2d"), img = new Image(), effectEl = document.getElementById("effect"), settings = { radius: 4, intensity: 25, ApplyFilter: function() { doOilPaintEffect(); } } img.addEventListener('load', function() { // reduced the size by half for pen and performance. canvas.width = (this.width / 2); canvas.height = (this.height / 2); ctx.drawImage(this, 0, 0, canvas.width, canvas.height); doOilPaintEffect(); }); function choosePhoto(){ alert(1) window["reddahApi"].album().then(data=>{ alert(data) img.src=data; doOilPaintEffect(); }) } img.crossOrigin = "Anonymous"; img.src = "assets/500/501.jpeg"; //"https://wow.techbrood.com/uploads/161001/normal2.jpg"; //var gui = new dat.GUI(); //gui.add(settings, 'intensity'); //gui.add(settings, 'radius'); //gui.add(settings, 'ApplyFilter'); function doOilPaintEffect() { oilPaintEffect(canvas, settings.radius, settings.intensity); } function oilPaintEffect(canvas, radius, intensity) { var width = canvas.width, height = canvas.height, imgData = ctx.getImageData(0, 0, width, height), pixData = imgData.data, // change to createElement getting added element just for the demo destCanvas = document.getElementById("dest-canvas"), dCtx = destCanvas.getContext("2d"), pixelIntensityCount = []; destCanvas.width = width; destCanvas.height = height; var destImageData = dCtx.createImageData(width, height), destPixData = destImageData.data, intensityLUT = [], rgbLUT = []; for (var y = 0; y < height; y++) { intensityLUT[y] = []; rgbLUT[y] = []; for (var x = 0; x < width; x++) { var idx = (y * width + x) * 4, r = pixData[idx], g = pixData[idx + 1], b = pixData[idx + 2], avg = (r + g + b) / 3; intensityLUT[y][x] = Math.round((avg * intensity) / 255); rgbLUT[y][x] = { r: r, g: g, b: b }; } } for (y = 0; y < height; y++) { for (x = 0; x < width; x++) { pixelIntensityCount = []; // Find intensities of nearest pixels within radius. for (var yy = -radius; yy <= radius; yy++) { for (var xx = -radius; xx <= radius; xx++) { if (y + yy > 0 && y + yy < height && x + xx > 0 && x + xx < width) { var intensityVal = intensityLUT[y + yy][x + xx]; if (!pixelIntensityCount[intensityVal]) { pixelIntensityCount[intensityVal] = { val: 1, r: rgbLUT[y + yy][x + xx].r, g: rgbLUT[y + yy][x + xx].g, b: rgbLUT[y + yy][x + xx].b } } else { pixelIntensityCount[intensityVal].val++; pixelIntensityCount[intensityVal].r += rgbLUT[y + yy][x + xx].r; pixelIntensityCount[intensityVal].g += rgbLUT[y + yy][x + xx].g; pixelIntensityCount[intensityVal].b += rgbLUT[y + yy][x + xx].b; } } } } pixelIntensityCount.sort(function(a, b) { return b.val - a.val; }); var curMax = pixelIntensityCount[0].val, dIdx = (y * width + x) * 4; destPixData[dIdx] = ~~(pixelIntensityCount[0].r / curMax); destPixData[dIdx + 1] = ~~(pixelIntensityCount[0].g / curMax); destPixData[dIdx + 2] = ~~(pixelIntensityCount[0].b / curMax); destPixData[dIdx + 3] = 255; } } // change this to ctx to instead put the data on the original canvas dCtx.putImageData(destImageData, 0, 0); } window["reddahApi"].loadCompleted()

body { text-align: center; background: #ececec; font-family: Tahoma, Geneva, sans-serif } section { display: inline-block } canvas { border: 1px solid #000 }
submitted 5 years ago ago by 1b54d14be50240948fc53b199a461f52
picture

Original

仿PS油画滤镜特效


40

var canvas = document.getElementById("canvas"), ctx = canvas.getContext("2d"), img = new Image(), effectEl = document.getElementById("effect"), settings = { radius: 4, intensity: 25, ApplyFilter: function() { doOilPaintEffect(); } } img.addEventListener('load', function() { // reduced the size by half for pen and performance. canvas.width = (this.width / 2); canvas.height = (this.height / 2); ctx.drawImage(this, 0, 0, canvas.width, canvas.height); doOilPaintEffect(); }); function choosePhoto(){ window["reddahApi"].album().then(data=>{ alert(data) data=data.replace("file://",""); img.src=data; doOilPaintEffect(); alert(2) }) } img.crossOrigin = "Anonymous"; img.src = "assets/500/501.jpeg"; //"https://wow.techbrood.com/uploads/161001/normal2.jpg"; //var gui = new dat.GUI(); //gui.add(settings, 'intensity'); //gui.add(settings, 'radius'); //gui.add(settings, 'ApplyFilter'); function doOilPaintEffect() { oilPaintEffect(canvas, settings.radius, settings.intensity); } function oilPaintEffect(canvas, radius, intensity) { var width = canvas.width, height = canvas.height, imgData = ctx.getImageData(0, 0, width, height), pixData = imgData.data, // change to createElement getting added element just for the demo destCanvas = document.getElementById("dest-canvas"), dCtx = destCanvas.getContext("2d"), pixelIntensityCount = []; destCanvas.width = width; destCanvas.height = height; var destImageData = dCtx.createImageData(width, height), destPixData = destImageData.data, intensityLUT = [], rgbLUT = []; for (var y = 0; y < height; y++) { intensityLUT[y] = []; rgbLUT[y] = []; for (var x = 0; x < width; x++) { var idx = (y * width + x) * 4, r = pixData[idx], g = pixData[idx + 1], b = pixData[idx + 2], avg = (r + g + b) / 3; intensityLUT[y][x] = Math.round((avg * intensity) / 255); rgbLUT[y][x] = { r: r, g: g, b: b }; } } for (y = 0; y < height; y++) { for (x = 0; x < width; x++) { pixelIntensityCount = []; // Find intensities of nearest pixels within radius. for (var yy = -radius; yy <= radius; yy++) { for (var xx = -radius; xx <= radius; xx++) { if (y + yy > 0 && y + yy < height && x + xx > 0 && x + xx < width) { var intensityVal = intensityLUT[y + yy][x + xx]; if (!pixelIntensityCount[intensityVal]) { pixelIntensityCount[intensityVal] = { val: 1, r: rgbLUT[y + yy][x + xx].r, g: rgbLUT[y + yy][x + xx].g, b: rgbLUT[y + yy][x + xx].b } } else { pixelIntensityCount[intensityVal].val++; pixelIntensityCount[intensityVal].r += rgbLUT[y + yy][x + xx].r; pixelIntensityCount[intensityVal].g += rgbLUT[y + yy][x + xx].g; pixelIntensityCount[intensityVal].b += rgbLUT[y + yy][x + xx].b; } } } } pixelIntensityCount.sort(function(a, b) { return b.val - a.val; }); var curMax = pixelIntensityCount[0].val, dIdx = (y * width + x) * 4; destPixData[dIdx] = ~~(pixelIntensityCount[0].r / curMax); destPixData[dIdx + 1] = ~~(pixelIntensityCount[0].g / curMax); destPixData[dIdx + 2] = ~~(pixelIntensityCount[0].b / curMax); destPixData[dIdx + 3] = 255; } } // change this to ctx to instead put the data on the original canvas dCtx.putImageData(destImageData, 0, 0); } window["reddahApi"].loadCompleted()

body { text-align: center; background: #ececec; font-family: Tahoma, Geneva, sans-serif } section { display: inline-block } canvas { border: 1px solid #000 }
submitted 5 years ago ago by 1b54d14be50240948fc53b199a461f52
picture

Original

仿PS油画滤镜特效


41

var canvas = document.getElementById("canvas"), ctx = canvas.getContext("2d"), img = new Image(), effectEl = document.getElementById("effect"), settings = { radius: 4, intensity: 25, ApplyFilter: function() { doOilPaintEffect(); } } img.addEventListener('load', function() { // reduced the size by half for pen and performance. canvas.width = (this.width / 2); canvas.height = (this.height / 2); ctx.drawImage(this, 0, 0, canvas.width, canvas.height); doOilPaintEffect(); }); function choosePhoto(){ window["reddahApi"].album().then(data=>{ alert(data) data=data.replace("file://",""); img.src=data; canvas.width = (this.width / 2); canvas.height = (this.height / 2); ctx.drawImage(this, 0, 0, canvas.width, canvas.height); doOilPaintEffect(); alert(2) }) } img.crossOrigin = "Anonymous"; img.src = "assets/500/501.jpeg"; //"https://wow.techbrood.com/uploads/161001/normal2.jpg"; //var gui = new dat.GUI(); //gui.add(settings, 'intensity'); //gui.add(settings, 'radius'); //gui.add(settings, 'ApplyFilter'); function doOilPaintEffect() { oilPaintEffect(canvas, settings.radius, settings.intensity); } function oilPaintEffect(canvas, radius, intensity) { var width = canvas.width, height = canvas.height, imgData = ctx.getImageData(0, 0, width, height), pixData = imgData.data, // change to createElement getting added element just for the demo destCanvas = document.getElementById("dest-canvas"), dCtx = destCanvas.getContext("2d"), pixelIntensityCount = []; destCanvas.width = width; destCanvas.height = height; var destImageData = dCtx.createImageData(width, height), destPixData = destImageData.data, intensityLUT = [], rgbLUT = []; for (var y = 0; y < height; y++) { intensityLUT[y] = []; rgbLUT[y] = []; for (var x = 0; x < width; x++) { var idx = (y * width + x) * 4, r = pixData[idx], g = pixData[idx + 1], b = pixData[idx + 2], avg = (r + g + b) / 3; intensityLUT[y][x] = Math.round((avg * intensity) / 255); rgbLUT[y][x] = { r: r, g: g, b: b }; } } for (y = 0; y < height; y++) { for (x = 0; x < width; x++) { pixelIntensityCount = []; // Find intensities of nearest pixels within radius. for (var yy = -radius; yy <= radius; yy++) { for (var xx = -radius; xx <= radius; xx++) { if (y + yy > 0 && y + yy < height && x + xx > 0 && x + xx < width) { var intensityVal = intensityLUT[y + yy][x + xx]; if (!pixelIntensityCount[intensityVal]) { pixelIntensityCount[intensityVal] = { val: 1, r: rgbLUT[y + yy][x + xx].r, g: rgbLUT[y + yy][x + xx].g, b: rgbLUT[y + yy][x + xx].b } } else { pixelIntensityCount[intensityVal].val++; pixelIntensityCount[intensityVal].r += rgbLUT[y + yy][x + xx].r; pixelIntensityCount[intensityVal].g += rgbLUT[y + yy][x + xx].g; pixelIntensityCount[intensityVal].b += rgbLUT[y + yy][x + xx].b; } } } } pixelIntensityCount.sort(function(a, b) { return b.val - a.val; }); var curMax = pixelIntensityCount[0].val, dIdx = (y * width + x) * 4; destPixData[dIdx] = ~~(pixelIntensityCount[0].r / curMax); destPixData[dIdx + 1] = ~~(pixelIntensityCount[0].g / curMax); destPixData[dIdx + 2] = ~~(pixelIntensityCount[0].b / curMax); destPixData[dIdx + 3] = 255; } } // change this to ctx to instead put the data on the original canvas dCtx.putImageData(destImageData, 0, 0); } window["reddahApi"].loadCompleted()

body { text-align: center; background: #ececec; font-family: Tahoma, Geneva, sans-serif } section { display: inline-block } canvas { border: 1px solid #000 }
submitted 5 years ago ago by 1b54d14be50240948fc53b199a461f52
picture

Original

仿PS油画滤镜特效


42

var canvas = document.getElementById("canvas"), ctx = canvas.getContext("2d"), img = new Image(), effectEl = document.getElementById("effect"), settings = { radius: 4, intensity: 25, ApplyFilter: function() { doOilPaintEffect(); } } img.addEventListener('load', function() { // reduced the size by half for pen and performance. canvas.width = (this.width / 2); canvas.height = (this.height / 2); ctx.drawImage(this, 0, 0, canvas.width, canvas.height); doOilPaintEffect(); }); function choosePhoto(){ window["reddahApi"].album().then(data=>{ img.src=data; canvas.width = (this.width / 2); canvas.height = (this.height / 2); ctx.drawImage(this, 0, 0, canvas.width, canvas.height); doOilPaintEffect(); alert(3) }) } img.crossOrigin = "Anonymous"; img.src = "assets/500/501.jpeg"; //"https://wow.techbrood.com/uploads/161001/normal2.jpg"; //var gui = new dat.GUI(); //gui.add(settings, 'intensity'); //gui.add(settings, 'radius'); //gui.add(settings, 'ApplyFilter'); function doOilPaintEffect() { oilPaintEffect(canvas, settings.radius, settings.intensity); } function oilPaintEffect(canvas, radius, intensity) { var width = canvas.width, height = canvas.height, imgData = ctx.getImageData(0, 0, width, height), pixData = imgData.data, // change to createElement getting added element just for the demo destCanvas = document.getElementById("dest-canvas"), dCtx = destCanvas.getContext("2d"), pixelIntensityCount = []; destCanvas.width = width; destCanvas.height = height; var destImageData = dCtx.createImageData(width, height), destPixData = destImageData.data, intensityLUT = [], rgbLUT = []; for (var y = 0; y < height; y++) { intensityLUT[y] = []; rgbLUT[y] = []; for (var x = 0; x < width; x++) { var idx = (y * width + x) * 4, r = pixData[idx], g = pixData[idx + 1], b = pixData[idx + 2], avg = (r + g + b) / 3; intensityLUT[y][x] = Math.round((avg * intensity) / 255); rgbLUT[y][x] = { r: r, g: g, b: b }; } } for (y = 0; y < height; y++) { for (x = 0; x < width; x++) { pixelIntensityCount = []; // Find intensities of nearest pixels within radius. for (var yy = -radius; yy <= radius; yy++) { for (var xx = -radius; xx <= radius; xx++) { if (y + yy > 0 && y + yy < height && x + xx > 0 && x + xx < width) { var intensityVal = intensityLUT[y + yy][x + xx]; if (!pixelIntensityCount[intensityVal]) { pixelIntensityCount[intensityVal] = { val: 1, r: rgbLUT[y + yy][x + xx].r, g: rgbLUT[y + yy][x + xx].g, b: rgbLUT[y + yy][x + xx].b } } else { pixelIntensityCount[intensityVal].val++; pixelIntensityCount[intensityVal].r += rgbLUT[y + yy][x + xx].r; pixelIntensityCount[intensityVal].g += rgbLUT[y + yy][x + xx].g; pixelIntensityCount[intensityVal].b += rgbLUT[y + yy][x + xx].b; } } } } pixelIntensityCount.sort(function(a, b) { return b.val - a.val; }); var curMax = pixelIntensityCount[0].val, dIdx = (y * width + x) * 4; destPixData[dIdx] = ~~(pixelIntensityCount[0].r / curMax); destPixData[dIdx + 1] = ~~(pixelIntensityCount[0].g / curMax); destPixData[dIdx + 2] = ~~(pixelIntensityCount[0].b / curMax); destPixData[dIdx + 3] = 255; } } // change this to ctx to instead put the data on the original canvas dCtx.putImageData(destImageData, 0, 0); } window["reddahApi"].loadCompleted()

body { text-align: center; background: #ececec; font-family: Tahoma, Geneva, sans-serif } section { display: inline-block } canvas { border: 1px solid #000 }
submitted 5 years ago ago by 1b54d14be50240948fc53b199a461f52
picture

Original

仿PS油画滤镜特效


43

var canvas = document.getElementById("canvas"), ctx = canvas.getContext("2d"), img = new Image(), effectEl = document.getElementById("effect"), settings = { radius: 4, intensity: 25, ApplyFilter: function() { doOilPaintEffect(); } } img.addEventListener('load', function() { // reduced the size by half for pen and performance. canvas.width = (this.width / 2); canvas.height = (this.height / 2); ctx.drawImage(this, 0, 0, canvas.width, canvas.height); doOilPaintEffect(); }); function choosePhoto(){ window["reddahApi"].album().then(data=>{ alert(data) img.src=data.replace("file:///","http://localhost:8080/_app_file_"); alert(img.src) alert(3) canvas.width = (this.width / 2); canvas.height = (this.height / 2); ctx.drawImage(this, 0, 0, canvas.width, canvas.height); doOilPaintEffect(); alert(3) }) } img.crossOrigin = "Anonymous"; img.src = "assets/500/501.jpeg"; //"https://wow.techbrood.com/uploads/161001/normal2.jpg"; //var gui = new dat.GUI(); //gui.add(settings, 'intensity'); //gui.add(settings, 'radius'); //gui.add(settings, 'ApplyFilter'); function doOilPaintEffect() { oilPaintEffect(canvas, settings.radius, settings.intensity); } function oilPaintEffect(canvas, radius, intensity) { var width = canvas.width, height = canvas.height, imgData = ctx.getImageData(0, 0, width, height), pixData = imgData.data, // change to createElement getting added element just for the demo destCanvas = document.getElementById("dest-canvas"), dCtx = destCanvas.getContext("2d"), pixelIntensityCount = []; destCanvas.width = width; destCanvas.height = height; var destImageData = dCtx.createImageData(width, height), destPixData = destImageData.data, intensityLUT = [], rgbLUT = []; for (var y = 0; y < height; y++) { intensityLUT[y] = []; rgbLUT[y] = []; for (var x = 0; x < width; x++) { var idx = (y * width + x) * 4, r = pixData[idx], g = pixData[idx + 1], b = pixData[idx + 2], avg = (r + g + b) / 3; intensityLUT[y][x] = Math.round((avg * intensity) / 255); rgbLUT[y][x] = { r: r, g: g, b: b }; } } for (y = 0; y < height; y++) { for (x = 0; x < width; x++) { pixelIntensityCount = []; // Find intensities of nearest pixels within radius. for (var yy = -radius; yy <= radius; yy++) { for (var xx = -radius; xx <= radius; xx++) { if (y + yy > 0 && y + yy < height && x + xx > 0 && x + xx < width) { var intensityVal = intensityLUT[y + yy][x + xx]; if (!pixelIntensityCount[intensityVal]) { pixelIntensityCount[intensityVal] = { val: 1, r: rgbLUT[y + yy][x + xx].r, g: rgbLUT[y + yy][x + xx].g, b: rgbLUT[y + yy][x + xx].b } } else { pixelIntensityCount[intensityVal].val++; pixelIntensityCount[intensityVal].r += rgbLUT[y + yy][x + xx].r; pixelIntensityCount[intensityVal].g += rgbLUT[y + yy][x + xx].g; pixelIntensityCount[intensityVal].b += rgbLUT[y + yy][x + xx].b; } } } } pixelIntensityCount.sort(function(a, b) { return b.val - a.val; }); var curMax = pixelIntensityCount[0].val, dIdx = (y * width + x) * 4; destPixData[dIdx] = ~~(pixelIntensityCount[0].r / curMax); destPixData[dIdx + 1] = ~~(pixelIntensityCount[0].g / curMax); destPixData[dIdx + 2] = ~~(pixelIntensityCount[0].b / curMax); destPixData[dIdx + 3] = 255; } } // change this to ctx to instead put the data on the original canvas dCtx.putImageData(destImageData, 0, 0); } window["reddahApi"].loadCompleted()

body { text-align: center; background: #ececec; font-family: Tahoma, Geneva, sans-serif } section { display: inline-block } canvas { border: 1px solid #000 }
submitted 5 years ago ago by 1b54d14be50240948fc53b199a461f52
picture

Original

仿PS油画滤镜特效


44

var canvas = document.getElementById("canvas"), ctx = canvas.getContext("2d"), img = new Image(), effectEl = document.getElementById("effect"), settings = { radius: 4, intensity: 25, ApplyFilter: function() { doOilPaintEffect(); } } img.addEventListener('load', function() { // reduced the size by half for pen and performance. canvas.width = (this.width / 2); canvas.height = (this.height / 2); ctx.drawImage(this, 0, 0, canvas.width, canvas.height); doOilPaintEffect(); }); function choosePhoto(){ window["reddahApi"].album().then(data=>{ alert(data) img.src=data.replace("file://","http://localhost:8080/_app_file_"); alert(img.src) alert(3) canvas.width = (this.width / 2); canvas.height = (this.height / 2); ctx.drawImage(this, 0, 0, canvas.width, canvas.height); doOilPaintEffect(); alert(3) }) } img.crossOrigin = "Anonymous"; img.src = "assets/500/501.jpeg"; //"https://wow.techbrood.com/uploads/161001/normal2.jpg"; //var gui = new dat.GUI(); //gui.add(settings, 'intensity'); //gui.add(settings, 'radius'); //gui.add(settings, 'ApplyFilter'); function doOilPaintEffect() { oilPaintEffect(canvas, settings.radius, settings.intensity); } function oilPaintEffect(canvas, radius, intensity) { var width = canvas.width, height = canvas.height, imgData = ctx.getImageData(0, 0, width, height), pixData = imgData.data, // change to createElement getting added element just for the demo destCanvas = document.getElementById("dest-canvas"), dCtx = destCanvas.getContext("2d"), pixelIntensityCount = []; destCanvas.width = width; destCanvas.height = height; var destImageData = dCtx.createImageData(width, height), destPixData = destImageData.data, intensityLUT = [], rgbLUT = []; for (var y = 0; y < height; y++) { intensityLUT[y] = []; rgbLUT[y] = []; for (var x = 0; x < width; x++) { var idx = (y * width + x) * 4, r = pixData[idx], g = pixData[idx + 1], b = pixData[idx + 2], avg = (r + g + b) / 3; intensityLUT[y][x] = Math.round((avg * intensity) / 255); rgbLUT[y][x] = { r: r, g: g, b: b }; } } for (y = 0; y < height; y++) { for (x = 0; x < width; x++) { pixelIntensityCount = []; // Find intensities of nearest pixels within radius. for (var yy = -radius; yy <= radius; yy++) { for (var xx = -radius; xx <= radius; xx++) { if (y + yy > 0 && y + yy < height && x + xx > 0 && x + xx < width) { var intensityVal = intensityLUT[y + yy][x + xx]; if (!pixelIntensityCount[intensityVal]) { pixelIntensityCount[intensityVal] = { val: 1, r: rgbLUT[y + yy][x + xx].r, g: rgbLUT[y + yy][x + xx].g, b: rgbLUT[y + yy][x + xx].b } } else { pixelIntensityCount[intensityVal].val++; pixelIntensityCount[intensityVal].r += rgbLUT[y + yy][x + xx].r; pixelIntensityCount[intensityVal].g += rgbLUT[y + yy][x + xx].g; pixelIntensityCount[intensityVal].b += rgbLUT[y + yy][x + xx].b; } } } } pixelIntensityCount.sort(function(a, b) { return b.val - a.val; }); var curMax = pixelIntensityCount[0].val, dIdx = (y * width + x) * 4; destPixData[dIdx] = ~~(pixelIntensityCount[0].r / curMax); destPixData[dIdx + 1] = ~~(pixelIntensityCount[0].g / curMax); destPixData[dIdx + 2] = ~~(pixelIntensityCount[0].b / curMax); destPixData[dIdx + 3] = 255; } } // change this to ctx to instead put the data on the original canvas dCtx.putImageData(destImageData, 0, 0); } window["reddahApi"].loadCompleted()

body { text-align: center; background: #ececec; font-family: Tahoma, Geneva, sans-serif } section { display: inline-block } canvas { border: 1px solid #000 }
submitted 5 years ago ago by 1b54d14be50240948fc53b199a461f52
picture

Original

仿PS油画滤镜特效


45

var canvas = document.getElementById("canvas"), ctx = canvas.getContext("2d"), img = new Image(), effectEl = document.getElementById("effect"), settings = { radius: 4, intensity: 25, ApplyFilter: function() { doOilPaintEffect(); } } img.addEventListener('load', function() { // reduced the size by half for pen and performance. canvas.width = (this.width / 2); canvas.height = (this.height / 2); ctx.drawImage(this, 0, 0, canvas.width, canvas.height); doOilPaintEffect(); }); function choosePhoto(){ window["reddahApi"].album().then(data=>{ img.src=data.replace("file://","http://localhost:8080/_app_file_"); canvas.width = (this.width / 2); canvas.height = (this.height / 2); ctx.drawImage(this, 0, 0, canvas.width, canvas.height); doOilPaintEffect(); }) } img.crossOrigin = "Anonymous"; img.src = "assets/500/501.jpeg"; //"https://wow.techbrood.com/uploads/161001/normal2.jpg"; //var gui = new dat.GUI(); //gui.add(settings, 'intensity'); //gui.add(settings, 'radius'); //gui.add(settings, 'ApplyFilter'); function doOilPaintEffect() { oilPaintEffect(canvas, settings.radius, settings.intensity); } function oilPaintEffect(canvas, radius, intensity) { var width = canvas.width, height = canvas.height, imgData = ctx.getImageData(0, 0, width, height), pixData = imgData.data, // change to createElement getting added element just for the demo destCanvas = document.getElementById("dest-canvas"), dCtx = destCanvas.getContext("2d"), pixelIntensityCount = []; destCanvas.width = width; destCanvas.height = height; var destImageData = dCtx.createImageData(width, height), destPixData = destImageData.data, intensityLUT = [], rgbLUT = []; for (var y = 0; y < height; y++) { intensityLUT[y] = []; rgbLUT[y] = []; for (var x = 0; x < width; x++) { var idx = (y * width + x) * 4, r = pixData[idx], g = pixData[idx + 1], b = pixData[idx + 2], avg = (r + g + b) / 3; intensityLUT[y][x] = Math.round((avg * intensity) / 255); rgbLUT[y][x] = { r: r, g: g, b: b }; } } for (y = 0; y < height; y++) { for (x = 0; x < width; x++) { pixelIntensityCount = []; // Find intensities of nearest pixels within radius. for (var yy = -radius; yy <= radius; yy++) { for (var xx = -radius; xx <= radius; xx++) { if (y + yy > 0 && y + yy < height && x + xx > 0 && x + xx < width) { var intensityVal = intensityLUT[y + yy][x + xx]; if (!pixelIntensityCount[intensityVal]) { pixelIntensityCount[intensityVal] = { val: 1, r: rgbLUT[y + yy][x + xx].r, g: rgbLUT[y + yy][x + xx].g, b: rgbLUT[y + yy][x + xx].b } } else { pixelIntensityCount[intensityVal].val++; pixelIntensityCount[intensityVal].r += rgbLUT[y + yy][x + xx].r; pixelIntensityCount[intensityVal].g += rgbLUT[y + yy][x + xx].g; pixelIntensityCount[intensityVal].b += rgbLUT[y + yy][x + xx].b; } } } } pixelIntensityCount.sort(function(a, b) { return b.val - a.val; }); var curMax = pixelIntensityCount[0].val, dIdx = (y * width + x) * 4; destPixData[dIdx] = ~~(pixelIntensityCount[0].r / curMax); destPixData[dIdx + 1] = ~~(pixelIntensityCount[0].g / curMax); destPixData[dIdx + 2] = ~~(pixelIntensityCount[0].b / curMax); destPixData[dIdx + 3] = 255; } } // change this to ctx to instead put the data on the original canvas dCtx.putImageData(destImageData, 0, 0); } window["reddahApi"].loadCompleted()

body { text-align: center; background: #ececec; font-family: Tahoma, Geneva, sans-serif } section { display: inline-block } canvas { border: 1px solid #000 }
submitted 5 years ago ago by 1b54d14be50240948fc53b199a461f52
picture

Original

仿PS油画滤镜特效


46

var canvas = document.getElementById("canvas"), ctx = canvas.getContext("2d"), img = new Image(), effectEl = document.getElementById("effect"), settings = { radius: 4, intensity: 25, ApplyFilter: function() { doOilPaintEffect(); } } img.addEventListener('load', function() { // reduced the size by half for pen and performance. canvas.width = (this.width / 2); canvas.height = (this.height / 2); ctx.drawImage(this, 0, 0, canvas.width, canvas.height); doOilPaintEffect(); }); function choosePhoto(){ window["reddahApi"].album().then(data=>{ img.src=data.replace("file://","http://localhost:8080/_app_file_"); canvas.width = "90%"//(this.width / 2); canvas.height = "90%"//(this.height / 2); ctx.drawImage(this, 0, 0, canvas.width, canvas.height); doOilPaintEffect(); }) } img.crossOrigin = "Anonymous"; img.src = "assets/500/501.jpeg"; //"https://wow.techbrood.com/uploads/161001/normal2.jpg"; //var gui = new dat.GUI(); //gui.add(settings, 'intensity'); //gui.add(settings, 'radius'); //gui.add(settings, 'ApplyFilter'); function doOilPaintEffect() { oilPaintEffect(canvas, settings.radius, settings.intensity); } function oilPaintEffect(canvas, radius, intensity) { var width = canvas.width, height = canvas.height, imgData = ctx.getImageData(0, 0, width, height), pixData = imgData.data, // change to createElement getting added element just for the demo destCanvas = document.getElementById("dest-canvas"), dCtx = destCanvas.getContext("2d"), pixelIntensityCount = []; destCanvas.width = width; destCanvas.height = height; var destImageData = dCtx.createImageData(width, height), destPixData = destImageData.data, intensityLUT = [], rgbLUT = []; for (var y = 0; y < height; y++) { intensityLUT[y] = []; rgbLUT[y] = []; for (var x = 0; x < width; x++) { var idx = (y * width + x) * 4, r = pixData[idx], g = pixData[idx + 1], b = pixData[idx + 2], avg = (r + g + b) / 3; intensityLUT[y][x] = Math.round((avg * intensity) / 255); rgbLUT[y][x] = { r: r, g: g, b: b }; } } for (y = 0; y < height; y++) { for (x = 0; x < width; x++) { pixelIntensityCount = []; // Find intensities of nearest pixels within radius. for (var yy = -radius; yy <= radius; yy++) { for (var xx = -radius; xx <= radius; xx++) { if (y + yy > 0 && y + yy < height && x + xx > 0 && x + xx < width) { var intensityVal = intensityLUT[y + yy][x + xx]; if (!pixelIntensityCount[intensityVal]) { pixelIntensityCount[intensityVal] = { val: 1, r: rgbLUT[y + yy][x + xx].r, g: rgbLUT[y + yy][x + xx].g, b: rgbLUT[y + yy][x + xx].b } } else { pixelIntensityCount[intensityVal].val++; pixelIntensityCount[intensityVal].r += rgbLUT[y + yy][x + xx].r; pixelIntensityCount[intensityVal].g += rgbLUT[y + yy][x + xx].g; pixelIntensityCount[intensityVal].b += rgbLUT[y + yy][x + xx].b; } } } } pixelIntensityCount.sort(function(a, b) { return b.val - a.val; }); var curMax = pixelIntensityCount[0].val, dIdx = (y * width + x) * 4; destPixData[dIdx] = ~~(pixelIntensityCount[0].r / curMax); destPixData[dIdx + 1] = ~~(pixelIntensityCount[0].g / curMax); destPixData[dIdx + 2] = ~~(pixelIntensityCount[0].b / curMax); destPixData[dIdx + 3] = 255; } } // change this to ctx to instead put the data on the original canvas dCtx.putImageData(destImageData, 0, 0); } window["reddahApi"].loadCompleted()

body { text-align: center; background: #ececec; font-family: Tahoma, Geneva, sans-serif } section { display: inline-block } canvas { border: 1px solid #000 }
submitted 5 years ago ago by 1b54d14be50240948fc53b199a461f52
picture

Original

仿PS油画滤镜特效


47

Welcome to use LiveStatus

LiveStatus
livestatus submitted 5 years ago ago by wind
picture

--Unable to find some TV shows on Xbox Video such as The Walking Dead and Supernatural?

--Having trouble searching the Forums?

--Unable to listen to your favorite tunes on the Slacker Radio application?

--Having difficulty viewing activity in your friends list? --Running into issues purchasing content from the Marketplace?

--Experiencing issues with the HBO GO application when attempting to stream or browse content?

......

Live Status is the one can tell you what's going on and when will the issue be resolved.

You can even subscribe a free notification to let you know when everything is up and running again!

Support Contact: weibailin@hotmail.com

48

What users say about LiveStatus

livestatus
livestatus submitted 5 years ago ago by wind
picture

The data is from Windows App Store:

https://www.microsoft.com/en-us/p/live-status/9nblggh0b2b9?activetab=pivot:reviewstab#

 

THE ULTIMATE G

Mobile

55User Rating: 5 out of 5

Submitted on4/20/2014

Review title of THE ULTIMATE G

Yes epic app to have 

5 out of 6 people found this helpful.

R

Reviewed ByRobert

Mobile

55User Rating: 5 out of 5

Submitted on8/9/2014

Review title of Robert

A great thing for any Xbox player to have. Only wish it had live tile integration.

6 out of 9 people found this helpful.

M

Reviewed ByMichael

Mobile

45User Rating: 4 out of 5

Submitted on1/7/2016

Review title of Michael

Excellent,dont have to test or login to see when its back on.. Just press a button and your phone tells you when LIVE is running again.. Thanks! /Micke (GT: SweWis ,on Xb1)

1 out of 1 people found this helpful.

T

Reviewed ByTimothy

Mobile

55User Rating: 5 out of 5

Submitted on10/6/2015

Review title of Timothy

Very good app 😊 

1 out of 1 people found this helpful.

N

Reviewed ByNicholas

Mobile

55User Rating: 5 out of 5

Submitted on8/26/2015

Review title of Nicholas

Quick and easy

1 out of 1 people found this helpful.

A

Reviewed Byaedan

Mobile

55User Rating: 5 out of 5

Submitted on8/19/2015

Review title of aedan

Easy to use and is always reliable 

1 out of 1 people found this helpful.

C

Reviewed Bychris

Mobile

45User Rating: 4 out of 5

Submitted on8/13/2015

Review title of chris

Nice app. I was wondering, however if the date/time shown on the top alert was posted by Dr. Who or of that is supposed to be projected date/time of service being restored. Because it shows a time which is at least six hours in the future for this region and the sub alerts seem to reflect a more likely time of posting. Bear in mind that i do Not get my Xbox live service from the opposite side of the world. I'm only 1 time zone away from Microsoft in Washington state. 

1 out of 1 people found this helpful.

U

Reviewed ByUser

Mobile

45User Rating: 4 out of 5

Submitted on6/30/2015

Review title of User

Excellent 

1 out of 1 people found this helpful.

C

Reviewed ByCharlie

Mobile

45User Rating: 4 out of 5

Submitted on3/19/2015

Review title of Charlie

You are are not helping my life still. 📡com

1 out of 1 people found this helpful.

F

Reviewed ByFima

Mobile

45User Rating: 4 out of 5

Submitted on12/20/2014

Review title of Fima

😲 

1 out of 1 people found this helpful.

49

var canvas = document.getElementById("canvas"), ctx = canvas.getContext("2d"), img = new Image(), effectEl = document.getElementById("effect"), settings = { radius: 4, intensity: 25, ApplyFilter: function() { doOilPaintEffect(); } } img.addEventListener('load', function() { // reduced the size by half for pen and performance. canvas.width = (this.width / 2); canvas.height = (this.height / 2); ctx.drawImage(this, 0, 0, canvas.width, canvas.height); }); function chooseFromPhoto(){ window["reddahApi"].album().then(data=>{ img.src=data.replace("file://","http://localhost:8080/_app_file_"); canvas.width = "90%"//(this.width / 2); canvas.height = "90%"//(this.height / 2); ctx.drawImage(this, 0, 0, canvas.width, canvas.height); }) } function chooseFromCamera(){ window["reddahApi"].camera().then(data=>{ img.src=data.replace("file://","http://localhost:8080/_app_file_"); canvas.width = "90%"//(this.width / 2); canvas.height = "90%"//(this.height / 2); ctx.drawImage(this, 0, 0, canvas.width, canvas.height); }) } img.crossOrigin = "Anonymous"; img.src = "assets/500/musk.jpg"; vl=1; function mt(v){ vl=v } function change(){ let base64Image = canvas.toDataURL('image/jpeg'); window["reddahApi"].qqMusk(vl,base64Image).then(data=>{ //alert(JSON.stringify(data)) if(data.Success==0){ let qqmsg = JSON.parse(data.Message); alert(qqmsg .ret) if(qqmsg .ret===0){ getBase64Image(qqmsg .data.image); } else{ alert('error1:'+JSON.stringify(data)) } } else{ alert('error2:'+JSON.stringify(data)) } }) } function getBase64Image(data){ alert(data) var dimg=document.getElementById("dest-img"); alert(dimg) dimg.src="data:image/jpeg;base64,"+data; dimg.width=img.width; dimg.height=img.height; }; window["reddahApi"].loadCompleted()

.test{ }
submitted 5 years ago ago by 054952f0c62a48c980ce39f09ddfcf4b
picture

Original

仿PS油画滤镜特效







50

var canvas = document.getElementById("canvas"), ctx = canvas.getContext("2d"), img = new Image(), effectEl = document.getElementById("effect"), settings = { radius: 4, intensity: 25, ApplyFilter: function() { doOilPaintEffect(); } } img.addEventListener('load', function() { // reduced the size by half for pen and performance. canvas.width = (this.width / 2); canvas.height = (this.height / 2); ctx.drawImage(this, 0, 0, canvas.width, canvas.height); }); function chooseFromPhoto(){ window["reddahApi"].album().then(data=>{ img.src=data.replace("file://","http://localhost:8080/_app_file_"); canvas.width = "90%"//(this.width / 2); canvas.height = "90%"//(this.height / 2); ctx.drawImage(this, 0, 0, canvas.width, canvas.height); }) } function chooseFromCamera(){ window["reddahApi"].camera().then(data=>{ img.src=data.replace("file://","http://localhost:8080/_app_file_"); canvas.width = "90%"//(this.width / 2); canvas.height = "90%"//(this.height / 2); ctx.drawImage(this, 0, 0, canvas.width, canvas.height); }) } img.crossOrigin = "Anonymous"; img.src = "assets/500/musk.jpg"; vl=1; function mt(v){ vl=v; change(); } function change(){ let base64Image = canvas.toDataURL('image/jpeg'); window["reddahApi"].qqMusk(vl,base64Image).then(data=>{ //alert(JSON.stringify(data)) if(data.Success==0){ let qqmsg = JSON.parse(data.Message); //alert(qqmsg .ret) if(qqmsg .ret===0){ getBase64Image(qqmsg .data.image); } else{ alert('error1:'+JSON.stringify(data)) } } else{ alert('error2:'+JSON.stringify(data)) } }) } function getBase64Image(data){ //alert(data) var dimg=document.getElementById("dest-img"); //alert(dimg) dimg.src="data:image/jpeg;base64,"+data; dimg.width=img.width; dimg.height=img.height; }; window["reddahApi"].loadCompleted()

.test{ }
submitted 5 years ago ago by 054952f0c62a48c980ce39f09ddfcf4b
picture

Original

仿PS油画滤镜特效







View more: < Prev Next > or try a Random SubReddah