当前位置:网站首页>Visual effects, picture to cartoon function
Visual effects, picture to cartoon function
2022-07-01 02:25:00 【Shadow night with the wind】
Using the latest AI technology , Provide old photo repair 、 Avatar animation 、 Head portrait 3D Gameplay 、 Character effects, etc 20 A variety of image processing technologies .

Visual effects
Using the latest AI technology , Provide old photo repair 、 Avatar animation 、 Head portrait 3D Gameplay 、 Character effects, etc 20 A variety of image processing technologies .
Open source is the front-end template , Open source is the front-end template , Open source is the front-end template , You can connect to the back end by yourself .
Baidu cloud and volcano engine interface for home page function docking , You need to apply for the interface yourself .
For more functions canvas Handle .
Next from 2 Introduce the following aspects :
1、 Version preview
2、 Technical points and interesting points to share
1、 Version preview
1、 Wechat applet
Search for Interesting avatar production
Or scan the code

2、qq Applet
Version review in progress , Update later
3、 Android app Download address




The renderings are as follows :


2、 Technical points and interesting points to share :
1、 Slide the picture

<template>
<view class="imgComparison" :style="'width:' + width + 'rpx;height:' + height + 'rpx'">
<view class="before-image" :style="'width:' + x + 'rpx'">
<view :style="'width:' + width + 'rpx;height:' + height + 'rpx'">
<image :src="beforeImageUrl" class="images" mode="aspectFill" data-type="before" @tap="previewImage">
</image>
</view>
<view v-if="beforeText" class="before-text">
{
{beforeText}}
</view>
</view>
<view class="after-image">
<view class="wrapper" v-if="wrapper"></view>
<view :style="'width:' + width + 'rpx;height:' + height + 'rpx'">
<video v-if="getSuffix(afterImageUrl) == 'mp4'" :src="afterImageUrl" :loop="true" class="images" data-type="after"></video>
<image v-else :src="afterImageUrl" class="images" mode="aspectFill" data-type="after" @tap="previewImage">
</image>
</view>
<view v-if="afterText" class="after-text">
{
{afterText}}
</view>
</view>
<view class="slider-bar" :style="'left:' + x + 'rpx'" @touchmove="handleTouchMove"
@touchstart="handleTouchStart" @touchend="handleTouchEnd">
<view class="slider-button"></view>
</view>
</view>
</template>handleTouchStart(event) {
this.isPressDown = true;
this.x = event.target.offsetLeft * 2;
if (this.x <= 0) {
this.x = this.width / 2;
}
},
handleTouchMove(event) {
if (!this.isPressDown) {
return;
}
this.x = event.touches[0].clientX * 2;
if (this.x >= this.width) {
this.x = this.width;
} else if (this.x <= 0) {
this.x = 0;
}
},
handleTouchEnd(event) {
this.isPressDown = false;
return false;
},2、 Small program image upload and app Image upload processing ( Picture is base64 Format )
Applets and app The upload method needs to be modified , The case is as follows :
chooseImage(){
let that = this;
uni.chooseImage({
count: 1, // Default 9
sizeType: ['compressed'], // You can specify whether it is original or compressed , By default, both of them have
sourceType: ['album', 'camera'],
success: function(res) {
let tempImagePath = res.tempFilePaths[0];
// Clear the previously selected picture
that.initImg();
// Upload and check the legitimacy of the image
// #ifndef H5
uni.compressImage({
src: tempImagePath,
quality: 80,
success: res1 => {
// If the last bit of the path is ., Do not upload the compressed path .
let uploadPath = res1.tempFilePath;
if(uploadPath.substr(uploadPath.length - 1, 1) == '.'){
uploadPath = tempImagePath;
}
that.uploadImg(uploadPath);
}
})
// #endif
// #ifdef H5
that.uploadImg(tempImagePath);
// #endif
}
});
},
uploadImg(path){
let that = this;
uni.getImageInfo({
src: path,
success: function(image) {
that.height = image.height / (image.width / that.width);
// Vertical and larger than the screen 70%, Halve the height directly to display
if(image.height > image.width && image.height > that.phone_height * 0.7){
that.height = that.height * 0.5
}
that.turnBase64IdCard(path)
}
});
that.beforeImageUrl = path;
that.wrapper = true;
},
turnBase64IdCard(file) {
let that = this;
// #ifdef APP-PLUS
plus.io.resolveLocalFileSystemURL(file, function(entry) {
entry.file(function(file) {
var fileReader = new plus.io.FileReader();
fileReader.readAsDataURL(file);
fileReader.onloadend = function(evt) {
let img = evt.target.result;
let newImg = img.split('base64,')[1];
newImg.trim().replace(/[\r\n]/g, "");
// Processing image upload
}
})
})
// #endif
// #ifdef MP-WEIXIN || MP-QQ
uni.getFileSystemManager().readFile({
filePath: file,
encoding: 'base64',
success: res => {
// Processing image upload
}
})
// #endif
},3、 Applets and app download base64 The picture is different
saveImageToPhotosAlbum(){
// #ifdef APP-NVUE
let base64=this.saveImageUrl
let timer = new Date().getTime();
const bitmap = new plus.nativeObj.Bitmap();
bitmap.loadBase64Data(base64, function() {
const url = "_doc/" + timer + ".png"; // url Name the timestamp
console.log('saveHeadImgFile', url)
bitmap.save(url, {
overwrite: true, // Is it covered?
// quality: 'quality' // Picture clarity
}, (i) => {
uni.saveImageToPhotosAlbum({
filePath: url,
success: function() {
uni.showToast({
title: ' Picture saved successfully ',
icon: 'none'
})
bitmap.clear()
}
});
}, (e) => {
uni.showToast({
title: ' Picture save failed ',
icon: 'none'
})
bitmap.clear()
});
}, (e) => {
uni.showToast({
title: ' Picture save failed ',
icon: 'none'
})
bitmap.clear()
});
// #endif
// #ifdef MP-WEIXIN || MP-QQ
let filePath=uni.env.USER_DATA_PATH + '/'+timer+'.png';
uni.getFileSystemManager().writeFile({
filePath:filePath , // Create a temporary file name
data: base64, // Written text or binary data
encoding: 'base64', // Write the character encoding of the current file
success: res => {
uni.saveImageToPhotosAlbum({
filePath: filePath,
success: function(res2) {
uni.showToast({
title: ' Saved successfully , Please choose to share again from the album ',
icon:"none",
duration:5000
})
},
fail: function(err) {
// console.log(err.errMsg);
}
})
},
fail: err => {
//console.log(err)
}
})
// #endif
},Various picture comparison interfaces , Apply for registration in volcano engine by yourself
Finally, the front-end code , Please refer to :
Please open and download the complete code
边栏推荐
- Go import self built package
- 手机上怎么开户?还有,在线开户安全么?
- SAP ALV汇总跟导出Excel 汇总数据不一致
- SWT/ANR问题--StorageManagerService卡住
- I want to know how to open a stock account? Is it safe to open an account online?
- Short video platform development, relying on drawerlayout to achieve side sliding menu effect
- SWT / anr problem - SWT caused by too long dump time
- [JS] [Nuggets] get people who are not followers
- Proxy support and SNI routing of pulsar
- Pulsar的Proxy支持和SNI路由
猜你喜欢

Ernie-gram, 显式、完备的 n-gram 掩码语言模型,实现了显式的 n-gram 语义单元知识建模。

Int and bit group turn to each other

在unity中使用jieba分词的方法

(翻译)实时内联验证更容易让用户犯错的原因

视觉特效,图片转成漫画功能

(总结一)Halcon基础之寻找目标特征+转正
![Pytorch - - Basic Reference North Deux élèves du secondaire peuvent comprendre [Rétropropagation et Gradient descendant]](/img/6e/279dbb7a8d7a5ecd240de464c5b8b2.png)
Pytorch - - Basic Reference North Deux élèves du secondaire peuvent comprendre [Rétropropagation et Gradient descendant]

Video tutorial | Chang'an chain launched a series of video tutorial collections (Introduction)

SWT/ANR问题--Binder Stuck

【2022年】江西省研究生数学建模方案、代码
随机推荐
Restcloud ETl数据通过时间戳实现增量数据同步
SWT / anr problem - storagemanagerservice stuck
C # generates PPK files in putty format (supports passphrase)
AI edge computing platform - beaglebone AI 64 introduction
int和位数组互转
(summary I) Halcon Foundation's target finding features + becoming a regular
What is PMP?
RocketQA:通过跨批次负采样(cross-batch negatives)、去噪的强负例采样(denoised hard negative sampling)与数据增强(data augment
运算符重载的初识
QML control type: tooltip
对象与对象变量
[JS] [Nuggets] get people who are not followers
[proteus simulation] Arduino UNO +74c922 keyboard decoding drive 4x4 matrix keyboard
Pytorch —— 基礎指北_貳 高中生都能看懂的[反向傳播和梯度下降]
CorelDRAW 2022中文精简64位直装版下载
2022年最新csdn涨薪技术栈-app自动化测试概述
Viewing JVM parameters
端口号和进程号的区别?
MySQL insert \ pre update + judgment condition
import tensorflow.contrib.slim as slim报错
https://vkceyugu.cdn.bspapp.com/VKCEYUGU-4049d7a8-5f2b-425b-be29-289beccc1088/179a7524-0608-4fed-807d-14ab6bd2587a.apk%C2%A0
https://www.volcengine.com/