タグ

2024年1月9日のブックマーク (4件)

  • Floyd–Steinberg dithering - Wikipedia

    A 1-bit image of the Statue of David, dithered with Floyd–Steinberg algorithm Floyd–Steinberg dithering is an image dithering algorithm first published in 1976 by Robert W. Floyd and Louis Steinberg. It is commonly used by image manipulation software, for example when an image is converted into GIF format, which is restricted to a maximum of 256 colors. The algorithm achieves dithering using error

    Floyd–Steinberg dithering - Wikipedia
    reboot_in
    reboot_in 2024/01/09
    “フロイド・スタインバーグ・ディザリング”
  • How to shuffle songs? - Spotify Engineering

    At Spotify we take user feedback seriously. We noticed some users complaining about our shuffling algorithm playing a few songs from the same artist right after each other. The users were asking “Why isn’t your shuffling random?”. We responded “Hey! Our shuffling is random!” So who was right? As it turns out, both we and the users were right but it’s a bit more complicated than that. It also tells

    How to shuffle songs? - Spotify Engineering
    reboot_in
    reboot_in 2024/01/09
    “全体として、アルゴリズムは非常にシンプルで、わずか数行で実装できます。また、非常に高速で、適切な結果が得られます。”
  • PILでEXIF Orientationタグを考慮して処理 - Qiita

    PIL(Pillow) で JPEG ファイルをオープンしたとき、EXIF の Orientation タグに値が設定されていても特に考慮されない。 Orientation タグに設定されている値に従った回転・フリップ処理を行った後のデータを生成する方法の実装例。 from PIL import Image file_path = "JPEG 画像ファイルのパス" # Orientation タグ値にしたがった処理 # PIL における Rotate の角度は反時計回りが正 convert_image = { 1: lambda img: img, 2: lambda img: img.transpose(Image.FLIP_LEFT_RIGHT), # 左右反転 3: lambda img: img.transpose(Image.ROTATE_180), # 180度回転 4: la

    PILでEXIF Orientationタグを考慮して処理 - Qiita
  • JPG画像に埋め込まれているdpi値は何のために存在するのか?

    この「総画素数」と「解像度」ってよォ~~~~~~ 総画素数のほうは分かる。スゲー分かる。 「どれだけ高画質か」を知るための大事な指標だからなァ だが 水平方向の解像度 350dpi 垂直方向の解像度 350dpi この2つはどういう意味なんだああ~~~~っ!? dpiってのは印刷するときに”自分で”決めるもんだろうがよーーーーーーッ!! ナメやがってこの言葉ァ!! 超イラつくぜぇ~~~~~ッ!! dpiとは? それはさておき、dpiって「1インチあたりどれだけドットが存在するか」という”密度の単位”ですよね。 つまり 水平方向の解像度 350dpi 垂直方向の解像度 350dpi というのは要するに「私を印刷する際は1インチあたり350ドットで印刷してくださいね!」ってこの画像が自分から言ってるようなもんですよね。 なんかそれっておかしな話ですよね。 だって「なんでお前の指図を受けにゃなら

    JPG画像に埋め込まれているdpi値は何のために存在するのか?
    reboot_in
    reboot_in 2024/01/09
    “・スキャナで取り込まれた画像のdpi値には意味がある。・デジカメで撮影されたJPG画像に埋め込まれているdpi値にはほとんど意味がない。ほとんどというか100%意味がない。(と思う。)”