:smiley: Telegram Bot @asciifacesbot that allows you to append ascii faces to your messages ¯\_(ツ)_/¯
:newspaper: More awesome hacker news!
:woman_artist: Telegram bot that posts new hot stories from Designer News, shots from Dribbble and projects from Behance to telegram channel
:notebook: List of awesome TIL (Today I Learned) repos and websites
API for most popular dribbble shots
Completing Advent of Code 2018 using deno
Client-side encryption on JavaScript
:memo: A curated list of awesome applications, softwares, tools and shiny things for OS X.
phil-r/empatika-server-practice 1
Practice makes perfect
A social coding experiment that updates its own code democratically.
starteduNetworking/uWebSockets.js
started time in 20 days
Pull request review commentKittl/vectorizing
def threshold_simple (img_grayscale): img_grayscale, 0, 255,- cv2.THRESH_BINARY_INV + cv2.THRESH_OTSU+ cv2.THRESH_BINARY + cv2.THRESH_OTSU )[1].astype(np.uint8) -def make_bitmap (img, method):+def threshold (img_grayscale, method):+ if method == 'SIMPLE':+ return threshold_simple(img_grayscale)+ + return threshold_adaptive(img_grayscale) - # Grayscale conversion- if not is_single_channel(img):+def rgba_on_white (img):+ r, g, b, a = cv2.split(img)+ n_alpha = a / 255 - # If the image is in RGBA format, composite it on top of a white background- # by combining linearly- if is_RGBA(img):- r, g, b, a = cv2.split(img)- n_alpha = a / 255+ r = (255 * (1 - n_alpha) + r * n_alpha).astype(np.uint8)+ g = (255 * (1 - n_alpha) + g * n_alpha).astype(np.uint8)+ b = (255 * (1 - n_alpha) + b * n_alpha).astype(np.uint8)++ return cv2.merge((r, g, b)) - r = (255 * (1 - n_alpha) + r * n_alpha).astype(np.uint8)- g = (255 * (1 - n_alpha) + g * n_alpha).astype(np.uint8)- b = (255 * (1 - n_alpha) + b * n_alpha).astype(np.uint8)+def invert (img):+ if is_RGBA(img):+ r, g, b, a = cv2.split(img)+ r = 255 - r+ g = 255 - g+ b = 255 - b+ return cv2.merge((r, g, b, a))+ + return 255 - img - img = cv2.merge((r, g, b))+def make_bitmap (img, method):+ inverted = invert(img)++ if not is_single_channel(img):+ + if is_RGBA(img):+ img = rgba_on_white(img)+ inverted = rgba_on_white(inverted) - img_grayscale = cv2.cvtColor(+ # Grayscale conversion+ grayscale = cv2.cvtColor( img, cv2.COLOR_RGB2GRAY ) - # If image is single channel, no conversion is needed+ inverted_grayscale = cv2.cvtColor(+ inverted,+ cv2.COLOR_RGB2GRAY+ )++ candidates = [grayscale, inverted_grayscale]+ else:- img_grayscale = img+ candidates = [img, inverted] - if method == 'SIMPLE':- thresholded = threshold_simple(img_grayscale)+ candidates = [threshold(img, method) for img in candidates] - else:- thresholded = threshold_adaptive(img_grayscale)- + bitmap, inverted_bitmap = [+ np.where(candidate == 255, 0, 1).astype(np.uint32) + for candidate in candidates+ ]++ pixel_count = get_pixel_count(img)+ foreground_area = np.sum(bitmap)+ inverted_foreground_area = np.sum(inverted_bitmap)++ if (foreground_area / pixel_count) < 0.001:
0.001
is not one percent
comment created time in 23 days
Pull request review commentKittl/vectorizing
def threshold_simple (img_grayscale): img_grayscale, 0, 255,- cv2.THRESH_BINARY_INV + cv2.THRESH_OTSU+ cv2.THRESH_BINARY + cv2.THRESH_OTSU )[1].astype(np.uint8) -def make_bitmap (img, method):+def threshold (img_grayscale, method):+ if method == 'SIMPLE':+ return threshold_simple(img_grayscale)+ + return threshold_adaptive(img_grayscale) - # Grayscale conversion- if not is_single_channel(img):+def rgba_on_white (img):+ r, g, b, a = cv2.split(img)+ n_alpha = a / 255 - # If the image is in RGBA format, composite it on top of a white background- # by combining linearly- if is_RGBA(img):- r, g, b, a = cv2.split(img)- n_alpha = a / 255+ r = (255 * (1 - n_alpha) + r * n_alpha).astype(np.uint8)+ g = (255 * (1 - n_alpha) + g * n_alpha).astype(np.uint8)+ b = (255 * (1 - n_alpha) + b * n_alpha).astype(np.uint8)++ return cv2.merge((r, g, b)) - r = (255 * (1 - n_alpha) + r * n_alpha).astype(np.uint8)- g = (255 * (1 - n_alpha) + g * n_alpha).astype(np.uint8)- b = (255 * (1 - n_alpha) + b * n_alpha).astype(np.uint8)+def invert (img):+ if is_RGBA(img):+ r, g, b, a = cv2.split(img)+ r = 255 - r+ g = 255 - g+ b = 255 - b+ return cv2.merge((r, g, b, a))+ + return 255 - img - img = cv2.merge((r, g, b))+def make_bitmap (img, method):+ inverted = invert(img)++ if not is_single_channel(img):+ + if is_RGBA(img):+ img = rgba_on_white(img)+ inverted = rgba_on_white(inverted) - img_grayscale = cv2.cvtColor(+ # Grayscale conversion+ grayscale = cv2.cvtColor( img, cv2.COLOR_RGB2GRAY ) - # If image is single channel, no conversion is needed+ inverted_grayscale = cv2.cvtColor(+ inverted,+ cv2.COLOR_RGB2GRAY+ )++ candidates = [grayscale, inverted_grayscale]+ else:- img_grayscale = img+ candidates = [img, inverted] - if method == 'SIMPLE':- thresholded = threshold_simple(img_grayscale)+ candidates = [threshold(img, method) for img in candidates] - else:- thresholded = threshold_adaptive(img_grayscale)- + bitmap, inverted_bitmap = [+ np.where(candidate == 255, 0, 1).astype(np.uint32) + for candidate in candidates+ ]++ pixel_count = get_pixel_count(img)+ foreground_area = np.sum(bitmap)+ inverted_foreground_area = np.sum(inverted_bitmap)++ if (foreground_area / pixel_count) < 0.001:+ # If total area of the foreground is less than 1 percent of the image's++ # It's possible that the inverted image produced a better bitmap.+ # The main relevant case is an all-or-mostly white foreground with a transparent background.++ #NOTE: The inverted bitmap CAN be worse than the non-inverted one.+ # e.g A very small amount of black pixels on a transparent background++ if inverted_foreground_area > foreground_area:+ # Then the inverted bitmap is better. And its area is at least 1.
1 what? pixel?
comment created time in 23 days
startedjafarlihi/core86
started time in a month
startedmodularml/mojo
started time in a month
startedyisibl/resvg-js
started time in a month
push eventphil-r/awesome-hacker-news
commit sha e94928809eeddc6ab672e930fa5d0269baec53d0
Add npm badge
push time in 2 months
created tagphil-r/awesome-hacker-news
:newspaper: More awesome hacker news!
created time in 2 months
push eventphil-r/awesome-hacker-news
commit sha e57c37af0867ab8383e76660e3cd3936aae97633
Move more dead projects to the graveyard
commit sha 78a7f944b239ee3bc1c1109faa4dce6579dc8f72
1.0.9
push time in 2 months
push eventphil-r/awesome-hacker-news
commit sha fb0dcfb4e9b0185245d32fa098404a012233639b
Re-generate readme
push time in 2 months
created tagphil-r/awesome-hacker-news
:newspaper: More awesome hacker news!
created time in 2 months
push eventphil-r/awesome-hacker-news
commit sha 294351ba8a436305dfcf266a00edd8b4f81ed89d
Add Hacki mobile app
commit sha 5997ce81670664dcc9026b6059fbbe750b63fbbf
1.0.8
push time in 2 months
created tagphil-r/awesome-hacker-news
:newspaper: More awesome hacker news!
created time in 2 months
push eventphil-r/awesome-hacker-news
commit sha 38b804ecda88f6b9845332e1a8378206d78c34f9
Move some dead projects to the graveyard
commit sha 92a3d77bea7b5144bbd520807daa810ae40bb1ac
1.0.7
push time in 2 months
created tagphil-r/awesome-hacker-news
:newspaper: More awesome hacker news!
created time in 2 months
push eventphil-r/awesome-hacker-news
commit sha 650c4e9bc84fe84a6e738544b9f66c4286dd09ee
Add test script placeholder
commit sha 7cfc72a397e3823faf0b752b064dc3c3c20d5a5d
1.0.6
push time in 2 months
PR closed phil-r/awesome-hacker-news
cc authors: @Mevaser @ylogx @yegle 🎉
pr closed time in 2 months
push eventphil-r/awesome-hacker-news
commit sha 59a835a56e062d91d133355e637f03674c7a9d1f
Add new sources, closes #3
push time in 2 months