Skip to content

Commit 1d56405

Browse files
committed
transparent background
1 parent ea20890 commit 1d56405

File tree

3 files changed

+45
-3
lines changed

3 files changed

+45
-3
lines changed

_pages/about.md

+7-3
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
layout: about
33
title: about
44
permalink: /
5-
subtitle: <a href='#'>University of Pittsburgh</a>. Pittsburgh PA, US
5+
subtitle: <a href='#'>University of Pittsburgh</a>. ZhanpengLuo at Pitt dot edu
66

77
profile:
88
align: right
9-
image: zhanpeng_bg.png
9+
image: zhanpeng_bg1.png
1010
image_circular: false # crops the image to make it circular
1111
more_info:
1212

@@ -18,4 +18,8 @@ social: False # includes social icons at the bottom of the page
1818

1919
I am Zhanpeng Luo, a third year computer science major student at University of Pittsburgh (Pitt). I spent 2 years at Sichuan University, and then I transfer to the Univerisity of Pittsburgh.
2020

21-
I am passionate about three-dimensional vision, real-time rendering and generative model. Specifically, I am working on the optimization process of gaussian splatting, towards training seamlessly on arbitrary large scene. Currently, I am supervised by [Dr.Bernhard Kerbl](https://snosixtyboo.github.io/).
21+
I am interested in three-dimensional vision, real-time rendering and generative model. Specifically, I am working on the optimization process of gaussian splatting, towards training seamlessly on arbitrary large scene. Currently, I am supervised by [Dr.Bernhard Kerbl](https://snosixtyboo.github.io/).
22+
23+
In my spare time, I often cook. Here is some of my cuisines I made after I come to the United States, and I also work out. If you are at Okaland, Pittsburgh, we can play baskteball together at the Trees Hall.
24+
25+
If you would like to chat about life, cuisine, or CV, CG, or gaussian splatting, please directly send me a email.

assets/img/zhanpeng_bg1.png

264 KB
Loading

script.py

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
#!/usr/bin/env python3
2+
3+
import sys
4+
from PIL import Image
5+
6+
def make_white_transparent(input_path, output_path):
7+
# Open the image and ensure it is in RGBA format
8+
img = Image.open(input_path).convert("RGBA")
9+
10+
datas = img.getdata()
11+
new_data = []
12+
13+
for item in datas:
14+
# item is in the format (R, G, B, A)
15+
r, g, b, a = item
16+
# Check if pixel is pure white (255, 255, 255)
17+
if r == 255 and g == 255 and b == 255:
18+
# Make it transparent by setting A=0
19+
new_data.append((255, 255, 255, 0))
20+
else:
21+
new_data.append(item)
22+
23+
# Update image data with new_data
24+
img.putdata(new_data)
25+
# Save in PNG format (which supports transparency)
26+
img.save(output_path, "PNG")
27+
28+
def main():
29+
30+
31+
input_file = "/Users/luozhanpeng/Code/Website/Zhanpeng1202.github.io/assets/img/zhanpeng_bg.png"
32+
output_file = "/Users/luozhanpeng/Code/Website/Zhanpeng1202.github.io/assets/img/zhanpeng_bg1.png"
33+
34+
make_white_transparent(input_file, output_file)
35+
print(f"Finished. Transparent image saved as: {output_file}")
36+
37+
if __name__ == "__main__":
38+
main()

0 commit comments

Comments
 (0)