canvas实现对图片进行素描颜色替换效果代码

代码语言:html

所属分类:其他

代码描述:canvas实现对图片进行素描颜色替换效果代码,可上传图文对图片进行黑白素描,颜色替换等效果。

代码标签: canvas 图片 素描 颜色 替换

下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开

<!DOCTYPE html>
<html lang="en" >
<head>
<meta charset="UTF-8">

<style>
*{
	border: 0;
	box-sizing: border-box;
	margin: 0;
	padding: 0;
}
:root {
	font-size: calc(16px + (24 - 16) * (100vw - 320px) / (2560 - 320));
	--bg: #737a8c;
	--buttonBg: #2762f3;
	--buttonHoverBg: #0c48db;
	--formBg: #fff;
	--inputBorder: #abafba;
	--inputBg: #fff;
	--inputDisableBg: #e3e4e8;
	--pColor: #17181c;
}
body, button, input {
	color: var(--pColor);
	font: 1em/1.5 "Hind", system-ui, -apple-system, sans-serif;
}
body, .upload-btn {
	overflow: hidden;
}
body {
	background: var(--bg);
	display: flex;
	flex-direction: column-reverse;
	height: 100vh;
}
aside, button, canvas, input, main, .upload-btn input[type=file] {
	width: 100%;
}
aside {
	background: var(--formBg);
	box-shadow: 0 0 0.25em hsla(223,10%,10%,0.5);
	overflow: auto;
}
button, input {
	-webkit-appearance: none;
	-moz-appearance: none;
	appearance: none;
}
button, input[type=color], input[type=file] {
	cursor: pointer;
}
button:hov.........完整代码请登录后点击上方下载按钮下载查看

网友评论0