大家好,今天用Python做了一个网页版的“P图软件”,大致的流程在于我们可以将上传的照片进行黑白处理、铅笔素描处理、模糊化处理等一系列操作,具体如下

下面我们来看一下该整个网页是怎么写的
网页左侧的工具栏部分
首先第一步在于导入我们所需要用到的模块,代码如下
import streamlit as st
import numpy as np
import cv2
from PIL import Image, ImageEnhance
我们先设计到网页当中的标题和左边的工具栏,左边的工具栏部分代码如下
st.sidebar.markdown('<p class="font">My First Photo Converter App</p>', unsafe_allow_html=True)
with st.sidebar.expander("About the App"):
st.write("""
Use this simple app to convert your favorite photo to a pencil sketch, a grayscale image or an image with blurring effect. \n \nThis app was created by Junxin as a side project to learn Streamlit and computer vision. Hope you enjoy!
""")
首先在工具栏当中添加的是关于该应用的介绍,通过调用streamlit模块当中的sidebar方法来生成一个下拉框,在通过点击“+”键来打开,

本文介绍了如何使用Python创建一个网页版的图片编辑应用,提供了照片的黑白处理、铅笔素描和模糊化等效果。通过streamlit库实现界面交互,包括左侧工具栏、图片上传及处理功能。
最低0.47元/天 解锁文章

被折叠的 条评论
为什么被折叠?



