安卓CMYK模式
我有一个 CMYK 模式的位图,它在 Android 上无法正确显示,有时根本无法显示。谷歌搜索没有返回很多答案,所以我必须在这里问如何处理 CMYK 模式图像?
谢谢
更新
好的,根据要求提供更多信息。我在资源中有一张图像,我用它构建了一个位图。然后,当我构建位图时,我会这样做:
Bitmap bm = Bitmap.createBitmap(width, height, Config.ARGB_8888);
图像处于 CMYK 模式。 当我把它放在 ImageView 上时 - 它显示为白色框。未显示。
希望这有帮助。
I have a Bitmap in CMYK mode, which doesn't show correctly, and at some point not at all, on Android. Googling didn't return many answers, so I have to ask here how do I handle CMYK mode images?
Thanks
UPDATE
Ok, more info as requested. I have a image that is in the assets, and I construct a Bitmap out of it. Then when I construct the Bitmap I do it like:
Bitmap bm = Bitmap.createBitmap(width, height, Config.ARGB_8888);
The Image is in CMYK mode.
When I put it on a ImageView - it appears as white box. Not shown.
Hope this helps.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
CMYK 是一种打印格式。所有“标准”结构,例如 jpeg、位图等,都是针对 SCREEN 的,并且可以像 RGB 一样读取您的结构。将结果放入 PDF 或其他 postscript 中,您就会看到它 OK。
CMYK is a format for PRINTING. All "standard" structures , such as jpeg, bitmaps and so on, are for a SCREEN, and read your structure as if it were RGB. Put the result in PDF or other postscript and you'll see it OK.
我做到了!我发现了一个很好的工具,可以在 Android 平台上正确处理具有不常见色彩空间(如 CMYK、YCCK 等)的 *.jpg 文件。
使用 https://github.com/puelocesar/android-lib-magick,它是免费的并且易于配置android库。
以下是将 CMYK 图像转换为 RGB 色彩空间的片段:
I made it! I found a nice tool for correct handling *.jpg files on Android platform with uncommon colorspaces like CMYK, YCCK and so on.
Use https://github.com/puelocesar/android-lib-magick, it's free and easy to configure android library.
Here is a snippet for converting CMYK images to RGB colorspace:
我还使用了 https://github.com/puelocesar/android-lib-magick
以下是我的代码,您不需要在存储上创建新文件:
I also used the library from https://github.com/puelocesar/android-lib-magick
Below is my code, u dont need to create new file on storage:
这里是使用 android-lib-magick 显示带有 CMYK 的图像colorspare(Android 不支持),从 URL 获取。
https://github.com/Mariovc/GetCMYKImage
有两种方法,称为“getCMYKImageFromPath”和“getCMYKImageFromURL” 。
Here is an example code using android-lib-magick to display an image with CMYK colorspare (not supported by Android), which is got from an URL.
https://github.com/Mariovc/GetCMYKImage
There are two methods called "getCMYKImageFromPath" and "getCMYKImageFromURL".