转跳到内容

tetrohedro

【会员】限制会员
  • 内容数

    19
  • 加入

  • 最后访问

tetrohedro 发表的所有内容

  1. 我在综合事务所无法发帖 只能等待自由的那一天了
  2. 这就是残酷的现实吗。 我也注意到了,很多内联样式会失踪.....
  3. 极限一定会被突破的! 虽然我没有思路,但是我相信后生可畏!
  4. 我要速通穿越!没有障碍能阻挡我。 可惜同盟的每日签到系统不是点击特定按钮签到,而是回复指定帖子签到。 很多论坛的每日签到系统有Bug,只要在极短时间内签到多次,就能绕过每日签到只有一次的限制.......
  5. 正在头脑风暴中 比如我们可以在图表的背景图片中藏一段文字,这样直接读HTML就读不出来了。 Kris神教是真的!
  6. 是的,刚写的! 为了表达我对你的排版技术的憧憬,我抱着热情写下了这个脚本。 不过失败了很多次...... 这个论坛会给表格加很多CSS Style,所以需要调试。
  7. 好开心! 这个游戏好好玩,以后可不可以做类似的解密企划?隐藏一段秘密,解密即可获得奖励。
  8. 诈骗失败 X2 前面一直在研究前辈和其他人的排版,然后就和Claude一起手搓了一个自动根据图片排版的Python脚本。 #!/usr/bin/env python3 """Convert an image to an HTML table where each cell represents a pixel.""" from PIL import Image import sys import os def image_to_html_table(image_path, output_path, width=120): """Convert an image to an HTML table. Args: image_path: Path to the input image output_path: Path for the output HTML file width: Target width in cells (height calculated to maintain aspect ratio) """ # Load the image img = Image.open(image_path) # Calculate new height to maintain aspect ratio aspect_ratio = img.height / img.width height = int(width * aspect_ratio) # Resize the image img = img.resize((width, height), Image.Resampling.LANCZOS) # Convert to grayscale img = img.convert('L') # Get pixel data pixels = list(img.getdata()) # Build HTML html = """<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>Bad Apple - HTML Table</title> </head> <body> <table style="border-collapse:collapse;table-layout:fixed"> """ # Generate table rows for y in range(height): html += " <tr>" for x in range(width): pixel_value = pixels[y * width + x] # Convert grayscale to hex color hex_color = f"#{pixel_value:02x}{pixel_value:02x}{pixel_value:02x}" html += f'<td style="background-color:{hex_color};width:6px;height:6px;padding:0;line-height:0"></td>' html += "</tr>\n" html += """ </table> </body> </html> """ # Write output with open(output_path, 'w') as f: f.write(html) print(f"Generated HTML table: {output_path}") print(f"Dimensions: {width}x{height} cells") if __name__ == "__main__": if len(sys.argv) < 2: print("Usage: python image_to_table_v2.py <image_path> [width]") sys.exit(1) image_path = sys.argv[1] # Derive output path from input filename base_name = os.path.splitext(os.path.basename(image_path))[0] output_path = f"{base_name}_table.html" # Optional: accept width from command line width = int(sys.argv[2]) if len(sys.argv) > 2 else 120 image_to_html_table(image_path, output_path, width)
  9. 我的近视眼又加深了一点 我是第一个吗!? 我要尝试认领20节操!如果我是四个月第一个发现的人的话,能不能多给一些。
  10. 先做出不会动的Bad Apple,才能做出会动的Bad Apple。 不过我怀疑静态效果可能是排版系统的极限了。这个系统似乎不支持动态效果,最后的结果只会一动不动。
  11. 我强烈推荐....... 外道勇者一行!~! 剧情轻松,牛度适中,和来自深渊一样,都是需要放松时可以轻松享受的作品。 (无辜的双眼)
  12. 复杂的排版的确会让人感到头疼呢 不过排版同时也很有趣!同盟的前辈们用排版做出了很有趣的效果,我也要向他们学习!
  13. 前辈你好~! 我是杂食主义者,不过我的朋友是牛头人考古学家。 我的朋友和我说同盟是很多游戏开发者的梦的起点,包括开发除灵和妹神官的BBQ大好,诅咒铠甲的wolfzq都曾是同盟用户。 如果牛头人部落允许双重国籍的话,那我也希望能加入牛头人部落!
  14. 那当然是.... 寿司勇者的DEAD RED HOOD ci-en似乎已经很久没有更新了 也许等我成功腹击万恶之源100次后,就可以看到体验版了。
  15. 哇,大哥哥有100万节操,好厉害! 我也希望能成为百万富翁! 我看的新番很少,因为现在的新番全都是异世界 现在我期待的只有小圆的新剧场版
  16. 我也是,因为没做好保暖,所以光荣中枪。 现在还在和上呼吸道感染抗争中。
  17. 这作者对NTR的领悟可以作为牛头人学的论文。 作为新人,我现在只想快速穿越,早日看到全文。 没想到同盟还有如此高手。
  18. 新人冒泡 我主要靠Netflix和Crunchyroll,新番资源还是很全的。 不过老资源就得回归海盗本行了。
×
×
  • 新建...

重要消息

为使您更好地使用该站点,请仔细阅读以下内容: 使用条款