image-conversion

How can I display an image in the terminal?

。_饼干妹妹 提交于 2019-12-03 12:25:38
问题 Is there any sort of utility I can use to convert an image to ASCII and then print it in my terminal? I looked for one but couldn't seem to find any. 回答1: A program called cacaview allows you to do this. It is interactive, allowing you to pan, zoom, and change display modes. (Full size image) 回答2: Try using the Google-Ninja before asking! I found cacaview and aview. 回答3: more simply, you may use img2txt from the caca library ( cacaview is an image browser and opens a new window, which is not

How can I display an image in the terminal?

随声附和 提交于 2019-12-03 03:43:06
Is there any sort of utility I can use to convert an image to ASCII and then print it in my terminal? I looked for one but couldn't seem to find any. A program called cacaview allows you to do this. It is interactive, allowing you to pan, zoom, and change display modes. ( Full size image ) Try using the Google-Ninja before asking! I found cacaview and aview . more simply, you may use img2txt from the caca library ( cacaview is an image browser and opens a new window, which is not what is asked here I guess); For instance : $ img2txt /Users/foo/pool/libs/ipython/docs/resources/ipynb_icon

Replacing vector images in a PDF with raster images

守給你的承諾、 提交于 2019-12-03 03:10:18
问题 Is there any easy (scriptable) way to convert a PDF with vector images into a PDF with raster images? In other words, I want to generate a PDF with the exact same (un-rasterized) text but with each vector image replaced with a rasterized version. I occasionally read PDFs of technical articles on my Kindle, and have found that reading a PDF directly is frustrating. Thankfully, Amazon's automatic conversion of PDFs to the Kindle format does a good job of reflowing the text portions of most of

Replacing vector images in a PDF with raster images

旧巷老猫 提交于 2019-12-02 16:40:24
Is there any easy (scriptable) way to convert a PDF with vector images into a PDF with raster images? In other words, I want to generate a PDF with the exact same (un-rasterized) text but with each vector image replaced with a rasterized version. I occasionally read PDFs of technical articles on my Kindle, and have found that reading a PDF directly is frustrating. Thankfully, Amazon's automatic conversion of PDFs to the Kindle format does a good job of reflowing the text portions of most of PDFs I have tried. However, while raster images seem to make it through the conversion process fine,

Convert Bitmap to WebP Image?

爱⌒轻易说出口 提交于 2019-12-02 05:34:49
问题 Anyone know if it's possible to convert a Bitmap to a WebP image using C#? Been Google-ing around but wasn't able to find anything for C#. I found this: mc-kay/libwebp-sharp · GitHub but it doesn't seem to convert bitmaps to the WebP format. Any ideas? 回答1: Load a WebP image using (Bitmap image = WebPFormat.LoadFromStream(new FileStream("image.webp", FileMode.Open, FileAccess.Read))) { image.Save("image.png", ImageFormat.Png); } Save a WebP image using (Image image = Image.FromFile("image.jpg

Easy way to convert a Bitmap and Png Image to text and vice versa

眉间皱痕 提交于 2019-12-02 05:26:39
问题 what is the easiest way to translate a Bitmap & Png to string AND BACK AGAIN. Ive been trying to do some saves through memory streams and such but i cant seem to get it to work! Appearently i wasnt clear, what i want, is to be able to translate a Bitmap class, with an image in it.. into a system string. from there i want to be able to throw my string around for a bit, and then translate it back into a Bitmap to be displayed in a PictureBox. 回答1: Based on @peters answer I've ended up using

JPEG encoder super slow, how to Optimize it?

无人久伴 提交于 2019-12-01 21:06:13
I'm building an App with actionscript 3.0 in my Flash builder. This is a followup question this question . I need to upload the bytearray to my server, but the function i use to convert the bitmapdata to a ByteArray is super slow, So slow it freezes up my mobile device. my code is as follows: var jpgenc:JPEGEncoder = new JPEGEncoder(50); trace('encode'); //encode the bitmapdata object and keep the encoded ByteArray var imgByteArray:ByteArray = jpgenc.encode(bitmap); temp2 = File.applicationStorageDirectory.resolvePath("snapshot.jpg"); var fs:FileStream = new FileStream(); trace('fs'); try{ /

How to convert 32-bit RGBA Image to Grayscale preserving alpha

筅森魡賤 提交于 2019-12-01 13:47:14
I'd like to, in code and on demand, convert a 32-bit RGBA Image object (originally a 32-bit PNG) to its 32-bit grayscale counterpart. I've already read several other questions here, as well as many articles online. I've tried using ColorMatrix to do it, but it doesn't seem to handle the alpha very well. Pixels that are entirely opaque grayscale perfectly. Any pixel that is partially transparent seems not to translate well as there are still tinges of color in those pixels. It is enough to be noticeable. The ColorMatrix I use is as follows: new System.Drawing.Imaging.ColorMatrix(new float[][]{

How to Get UIImage from a 'Base64String' format raw image data, on iPhone?

六月ゝ 毕业季﹏ 提交于 2019-12-01 11:49:17
In my application, I receive the image data from the server in a XML file. This data is of an image( .jpeg or .png or .tiff etc) which the server, converts into 'Base64String' format bytes to send to my application through the XML file. At my application side, the application stores these bytes, in the form of 'NSData' into a database. Now, my application has to retrieve and show up the image at the later part. But I haven't been able to figure out how to get the UIImage from this 'Base64String' format raw image data? Kindly guide me in this regard, since I'm a 'just-in' developer in the world

C++ gdi::Bitmap to PNG Image in memory

爱⌒轻易说出口 提交于 2019-12-01 11:35:16
I'm trying to send a screenshot of a window over tcp to a server. Getting the screenshot is no problem (using GDIplus). The networking is also easy for me. The problem is trying to convert the gdi+ Bitmap to a png (in memory) to get the data out of it and send it to the server. Can anyone help me please? Gdiplus can save to file, or save to memory using IStream . See Gdiplus::Image::Save method //get gdi+ bitmap Gdiplus::Bitmap bitmap(hbitmap, nullptr); //write to IStream IStream* istream = nullptr; HRESULT hr = CreateStreamOnHGlobal(NULL, TRUE, &istream); CLSID clsid_png; CLSIDFromString(L"