Sorry if this has been posted before,
I'm wanting to create some sort of drag and drop img to bbcode creator.
So, here's what I know
- Newbie: No styling (including links) allowed. Max 40 characters.
- Jr. Member: Links allowed. Max 100 characters.
- Member: Unlimited length.
- Full: Color allowed.
- Sr. Member: Size allowed
- Hero: Background color allowed
Signatures taller than 42px will be cut off.
Things that would help
Character count for various PX sizes doesn't this change?
Any sort of live environment for testing that accurately replicate BCT signature paramaters?
Would anyone be willing to disclose methods for making ascii art to bbcode in the manner you guys do?
I could be wrong, but I feel there is some template you guys use to streamline your process.
I feel an ascii converter is what needs to be built on with output parameter tightened up.
I've always wondered why a tool like this hasn't been created for php boards like bitcointalk.org
I imagine there is no one size fits all solution and lots of challenges ahead if I choose to proceed.
Here is a rough draft to maybe give the others an idea of what Im trying to accomplish
feel free to build off it, contribute to it? (It's a quick gpt build)
import sys
from PIL import Image
# Open the image file
with Image.open(sys.argv[1]) as image:
# Convert the image to grayscale
image = image.convert("L")
# Resize the image to fit within a certain width(3888/12)?
width, height = image.size
aspect_ratio = height / width
new_width = 324
new_height = 12
image = image.resize((new_width, new_height))
# Iterate through the pixels in the image
for y in range(new_height):
for x in range(new_width):
# Get the pixel value
pixel = image.getpixel((x, y))
# Determine the ASCII character to use based on the pixel value
if pixel >= 250:
char = " "
elif pixel >= 245:
char = "▟"
elif pixel >= 240:
char = "▞"
elif pixel >= 235:
char = "▝"
elif pixel >= 230:
char = "▜"
elif pixel >= 225:
char = "▛"
elif pixel >= 220:
char = "▚"
elif pixel >= 215:
char = "▙"
elif pixel >= 210:
char = "▗"
elif pixel >= 205:
char = "▖"
elif pixel >= 200:
char = "▕"
elif pixel >= 195:
char = "▔"
elif pixel >= 190:
char = "▓"
elif pixel >= 185:
char = "▒"
elif pixel >= 180:
char = "░"
elif pixel >= 175:
char = "▐"
elif pixel >= 170:
char = "▏"
elif pixel >= 165:
char = "▎"
elif pixel >= 160:
char = "▍"
elif pixel >= 155:
char = "▌"
elif pixel >= 150:
char = "▋"
elif pixel >= 145:
char = "▊"
elif pixel >= 140:
char = "▉"
elif pixel >= 135:
char = "█"
elif pixel >= 130:
char = "▇"
elif pixel >= 125:
char = "▆"
elif pixel >= 120:
char = "▅"
elif pixel >= 115:
char = "▃"
elif pixel >= 110:
char = "▂"
elif pixel >= 105:
char = "▁"
elif pixel >= 100:
char = "▀"
else:
char = " "
# Print the ASCII character
sys.stdout.write(char)
# Print a newline after each row of pixels
sys.stdout.write("\n")
#To use this script, you can pass the file name of the input image as a command-line argument. For example:
#Copy code
#python ascii_art.py image.jpg