See: http://pgbovine.net/cpython-internals.htm

Pythonの画像ライブラリ「pillow」を使って、画像のカラーハーフトーン処理を実装しました。 写真をアメコミ調に変換したいときに、スクリーントーンのような陰影を再現したいときなどに使います。 ハーフトーンは、アメコミのような画風にしたり、ポップなデザインによく使われる効果です。 カラーハーフトーンはCMYKに色分解し、角度をずらしたハーフトーンを重ねる処理です。 カラーの印刷物のような効果になります。 当初は簡単に実装できるだろうとタカをくくっていたのですが、意外と面倒な処理でした。日本語の技術資料はほとんどなかったため、共有&精度向上のためにメモしておきます。 ハーフトーン処理の概要 ハーフトーンは、画像をある角度で配置された単色ドットでグラデーションを擬似的に表現するものです。 角度45°で、pitchはドットの間隔、rはドットの最大半径とすると、下図のようになります。 ここで問
<title>An icon of a outbound link arrow</title> <path class="icon-stroke" d="M75.3037 3.98207L3 75.5935M75.3037 3.98207L76.0435 43.3021M75.3037 3.98207L35.951 3.59351" stroke="#F22F46" stroke-width="5.5" stroke-linecap="round" stroke-linejoin="round"/> </svg> "> 2025 Gartner® Magic Quadrant™ for CPaaS <title>An icon of a outbound link arrow</title> <path class="icon-stroke" d="M75.3037 3.98207L3 7
By Paweł Piotr Przeradowski Is it possible to hit a million requests per second with Python? Probably not until recently. A lot of companies are migrating away from Python and to other programming languages so that they can boost their operation performance and save on server prices, but there’s no need really. Python can be right tool for the job. The Python community is doing a lot of around per
500 Lines or Less A Web Crawler With asyncio Coroutines A. Jesse Jiryu Davis and Guido van Rossum A. Jesse Jiryu Davis is a staff engineer at MongoDB in New York. He wrote Motor, the async MongoDB Python driver, and he is the lead developer of the MongoDB C Driver and a member of the PyMongo team. He contributes to asyncio and Tornado. He writes at http://emptysqua.re. Guido van Rossum is the crea
By dismissing the Python garbage collection (GC) mechanism, which reclaims memory by collecting and freeing unused data, Instagram can run 10% more efficiently. Yes, you heard it right! By disabling GC, we can reduce the memory footprint and improve the CPU LLC cache hit ratio. If you’re interested in knowing why, buckle up! How We Run Our Web ServerInstagram’s web server runs on Django in a multi
Check out the journal article about OSMnx. All figures in this article come from this journal article, which you can read/cite for more. The heart of Allan Jacobs’ classic book on street-level urban form and design, Great Streets, features dozens of hand-drawn figure-ground diagrams in the style of Nolli maps. Each depicts one square mile of a city’s street network. Drawing these cities at the sam
This website is a work–in–progress; it is a place where I share my thoughts, ideas, and projects with the world. Thanks for stopping by! I am a software engineer, writer, and speaker, and I am passionate about technology, open source, and education. Previously, I was very interested in photography and music as well. I am known mostly for my open–source creations, such a Requests and Pipenv. In the
この記事は KMC Advent Calendar 2016 及び ごちうさ Advent Calendar 2016 の15日目の記事です。 KMC Advent Calendar の前回の記事は uiureoさんの記事…はまだないので、その前の記事は walkureさんのゼネコンを九ヶ月で辞めた話 - (。・ω・。)ノ・☆':*;':* でした。 ごちうさ Advent Calendar の前回の記事は kivantiumさんの きんモザ・ごちうさ聖地巡礼記 - kivantium活動日記 でした。 はじめに 〜デキるエリートの場合〜 みなさんは、最新の社会情勢や時事が知りたい時、どうしていますか? テレビをつけてニュースを見ますか? それとも Yahoo!トップのニュースを見ますか? デキるエリートはそんな俗世的で時間のかかることはしません。 デキるエリートはまず「1」と検索窓に打ち
I'd like to announce version 2.0.0 of PyFilesystem, which is now available on PyPi. PyFilesystem is a Python module I started some time in 2008, and since then it has been very much a part of my personal standard library. I've used it in personal and professional projects, as have many other developers and organisations. Recap If you aren't familiar with PyFilesystem; it's an abstraction layer for
"I thought that memory leaks were impossible in Python?", I said to myself, staring incredulously at my screen. It was 8:00 PM. The memory use of my crawler was slowly, but steadily increasing. As I hadn't changed any significant portion of my code, this made no sense at all. Had I introduced a new bug? If so, where was it? Here follows the full story of how I tracked down a memory leak in my Pyth
Behind the scenes of Singapore’s nationwide ticket operating system for the National Day Parade
Introduction In most presentations of Riemannian geometry, e.g. O’Neill (1983) and Wikipedia, the fundamental theorem of Riemannian geometry (“the miracle of Riemannian geometry”) is given: that for any semi-Riemannian manifold there is a unique torsion-free metric connection. I assume partly because of this and partly because the major application of Riemannian geometry is General Relativity, con
This is an explanatory article related to my talk at MUPy — Become a pdb power-user. What’s pdb?pdb is a module from Python’s standard library that allows us to do things like: Stepping through source codeSetting conditional breakpointsInspecting stack traceViewing source codeRunning Python code in a contextPost-mortem debuggingWhy pdb?It is not necessary to use pdb all the time, sometimes we can
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く