[翻译] NSImage+HHTint - Tints grayscale images using CoreImage

简介:

NSImage+HHTint - Tints grayscale images using CoreImage

https://github.com/gloubibou/NSImage-HHTint

 

This category on NSImage adds a single method:

- (NSImage *)hh_imageTintedWithColor:(NSColor *)tint;

This method creates a tinted copy of the image. Colored / gray pixels of the original image lead to pixels of an equally dark shade of the tint color.

This code was originally written for Tembo.app. The navigation bar in Tembo is build from grayscale images. At runtime these are tinted to a dark blue. In Tembo's drill-down view the same process is applied to a stock NSSegementedControl to make it match the color of the navigation bar.

 

这个category给NSImage添加了一个方法:

- (NSImage *)hh_imageTintedWithColor:(NSColor *)tint;

这个方法会创建一个image的copy备份,之前灰度的图片会填充上一些颜色。

这份代码最初是写给应用Tembo.app的。Tembo应用中导航栏上的图片是灰白图片,运行时动态的填充为深蓝色。在Tembo的下拉view中,NSSegementedControl也用了同样的方式,在下拉过程中填充颜色来保持与导航栏上的颜色一致。

目录
相关文章
|
11天前
|
JSON 测试技术 API
阿里云PAI-Stable Diffusion开源代码浅析之(二)我的png info怎么有乱码
阿里云PAI-Stable Diffusion开源代码浅析之(二)我的png info怎么有乱码
|
2月前
|
人工智能 自然语言处理 物联网
【人工智能】Transformers之Pipeline(八):文生图/图生图(text-to-image/image-to-image)
【人工智能】Transformers之Pipeline(八):文生图/图生图(text-to-image/image-to-image)
55 2
|
2月前
|
机器学习/深度学习 编解码 自然语言处理
【文献学习】An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale
本文介绍了如何使用纯Transformer模型进行图像识别,并讨论了模型的结构、训练策略及其在多个图像识别基准上的性能。
64 3
|
5月前
|
Python Windows
PDF转Images
PDF转Images
45 1
|
机器学习/深度学习 自然语言处理 计算机视觉
论文总结与分析:“An Image is Worth 16x16 Words”
论文总结与分析:“An Image is Worth 16x16 Words”
161 0
论文总结与分析:“An Image is Worth 16x16 Words”
|
机器学习/深度学习 编解码 数据可视化
Text to image论文精读 从菜谱描述自动生成菜肴照片 CookGAN: Causality based Text-to-Image Synthesis(基于因果关系的文本图像合成 )
文章被2020 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR)会议录用。 论文地址:[https://ieeexplore.ieee.org/document/9157040/citations#citations](https://ieeexplore.ieee.org/document/9157040/citations#citations) CookGAN旨在解决因果关系效应。食物图像的因果演化隐含在一个连续的网络中。 本博客是精读这篇论文的报告,包含一些个人理解、知识拓展和总结。
Text to image论文精读 从菜谱描述自动生成菜肴照片 CookGAN: Causality based Text-to-Image Synthesis(基于因果关系的文本图像合成 )
|
机器学习/深度学习 自然语言处理 计算机视觉
Text to image论文精读 MirrorGAN: Learning Text-to-image Generation by Redescription(通过重新描述学习从文本到图像的生成)
MirrorGAN通过学习文本-图像-文本,试图从生成的图像中重新生成文本描述,从而加强保证文本描述和视觉内容的一致性。文章被2019 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR)会议录用。 论文地址:https://arxiv.org/abs/1903.05854 代码地址:https://github.com/qiaott/MirrorGAN
Text to image论文精读 MirrorGAN: Learning Text-to-image Generation by Redescription(通过重新描述学习从文本到图像的生成)
|
机器学习/深度学习 编解码 自然语言处理
Text to Image综述阅读(1.1):介绍与基本原理 Adversarial Text-to-Image Synthesis: A Review(基于GAN的文本生成图像)
基于GAN的文本生成图像,最早在2016年由Reed等人提出,最开始是Conditional GANs的扩展,仅在受限的数据集取得成果,小图像分辨率64*64。
Text to Image综述阅读(1.1):介绍与基本原理 Adversarial Text-to-Image Synthesis: A Review(基于GAN的文本生成图像)
|
机器学习/深度学习 编解码 人工智能
Text to image论文精读CogView: Mastering Text-to-Image Generation via Transformers(通过Transformer控制文本生成图像)
CogView是清华大学和阿里巴巴达摩院共同研究开发的一款用Transformer来控制文本生成图像的模型。该论文已被NIPS(Conference and Workshop on Neural Information Processing Systems,计算机人工智能领域A类会议)录用,文章发表于2021年10月。 论文地址:https://arxiv.org/pdf/2105.13290v3.pdf 代码地址:https://github.com/THUDM/CogView 本博客是精读这篇论文的报告,包含一些个人理解、知识拓展和总结。
Text to image论文精读CogView: Mastering Text-to-Image Generation via Transformers(通过Transformer控制文本生成图像)