jpeg

Convert .h5 file to .jpg with Python

吃可爱长大的小学妹 提交于 2020-01-04 01:59:26
问题 I currently have a .h5 file containing grayscale imagery. I need to convert it to a .jpg. Does anybody have any experience with this? Note: I could possible convert the h5 file to a numpy array and then use an external library like pypng to convert that to a png. But I am wondering if there is a more efficient way to convert to an image, and preferrably a .jpg. 回答1: Key ingredients: h5py to read the h5 file. Determine the format of your image and use PIL. Let us suppose it's RGB format (https

What format is this JPEG stream from my cheap Chinese IP webcam?

左心房为你撑大大i 提交于 2020-01-03 18:37:59
问题 I've got a cheap Chinese IP webcam that has a web interface showing live video. The video appears to be a sequence of jpeg images fed into the browser. If I point wget at the URL http://my-ip-camera/video.cgi I receive a big chunk of streamed data in the following format: --ipcamera Content-Type: image/jpeg Content-Length: 46056 JFIF header data ... lots of data ... this pattern repeats for every "frame". Is this some "standard" streaming format I can play/transcode with something, or is it

Read in JPG as RGB888 on Android

和自甴很熟 提交于 2020-01-03 13:01:18
问题 I'm trying to read in a .jpg using BitmapFactory. I want to get a RGB888 formatted bitmap, but I keep seeming to get RGB565. Is there anyway to change this? 回答1: BitmapFactory methods let you pass a BitmapFactory.Options instance. You can use BitmapFactory.Options to specifcy the inPreferredConfig, which defines the format of the Bitmap returned after decoding, just set it to Bitmap.Config.ARGB_8888. 来源: https://stackoverflow.com/questions/4866653/read-in-jpg-as-rgb888-on-android

Fast way to decode JPEG image

徘徊边缘 提交于 2020-01-03 08:52:33
问题 I need to decode (unpack into bitmap) pretty small (about 1200 * 1200) JPEG. The problem is I need to do it quickly. I have tried libjpeg, and it's quite slow. I have also tried BitmapFactory.decodeByteArray - it's a bit faster, but still not fast enough. What are another options? A native (C++) library is much preferred. P.S. My JPEGs are created directly in memory. P.P.S. I wonder how come libjpeg is slower than BitmapFactory.decodeByteArray. 回答1: Try Libjpeg Turbo: http://libjpeg-turbo

Fast way to decode JPEG image

谁说胖子不能爱 提交于 2020-01-03 08:51:30
问题 I need to decode (unpack into bitmap) pretty small (about 1200 * 1200) JPEG. The problem is I need to do it quickly. I have tried libjpeg, and it's quite slow. I have also tried BitmapFactory.decodeByteArray - it's a bit faster, but still not fast enough. What are another options? A native (C++) library is much preferred. P.S. My JPEGs are created directly in memory. P.P.S. I wonder how come libjpeg is slower than BitmapFactory.decodeByteArray. 回答1: Try Libjpeg Turbo: http://libjpeg-turbo

How to create mpeg video from images in java [duplicate]

て烟熏妆下的殇ゞ 提交于 2020-01-03 05:49:13
问题 This question already has answers here : Closed 7 years ago . Possible Duplicate: Java: How do I create a movie from an array of images? I have set of images in JPEG format that I want to convert into MPEG video with Java. How can it be done? 回答1: Look at Xuggler project: http://www.xuggle.com/xuggler/ 来源: https://stackoverflow.com/questions/11985706/how-to-create-mpeg-video-from-images-in-java

How should I create embed code to display my photos on someone else's website?

久未见 提交于 2020-01-03 03:27:20
问题 I have many photos already stored on my website and I want to allow other people to publish any of these photos on their own websites. What I'm trying to do is create embed code for each photo to allow third parties to publish a photo within an iframe (I'm using PHP). It's just like what Getty Images have done here - allowing others to embed their photos. Getty's embed code uses an iframe with the source to the image/webpage being something like this: src="//embed.gettyimages.com/embed

Lossless JPEG rotation during decoding with libjpeg

帅比萌擦擦* 提交于 2020-01-03 01:20:13
问题 I've got a simple C++ app that decodes JPEGs with libjpeg - however, some of the images it processes come out sideways! These input images have orientations baked in to the EXIF data by the camera, but it seems that during decompression, libjpeg isn't taking the orientation flag into account as many JPEG viewers do. Is there a way to get libjpeg to respect the orientation of the JPEG during decompression, or will I have to parse out this orientation tag and manually rotate the image? 回答1: the

iPhone JPG image has non-standard magic bytes ff d8 ff e1?

安稳与你 提交于 2020-01-02 07:07:50
问题 My web app checks the first four bytes against the file extension before accepting uploaded images. A coworker showed me images from his iPhone which are being rejected. These have a different fourth byte (e1 = 225 instead of the expected e0 = 224). Is this usual for iPhones? Are there other possible magic byte strings used in JPG files? Edit: found this useful list: http://www.garykessler.net/library/file_sigs.html 回答1: They seem to indicate a sub category of JPEG in some way. What I have

iPhone JPG image has non-standard magic bytes ff d8 ff e1?

≯℡__Kan透↙ 提交于 2020-01-02 07:07:01
问题 My web app checks the first four bytes against the file extension before accepting uploaded images. A coworker showed me images from his iPhone which are being rejected. These have a different fourth byte (e1 = 225 instead of the expected e0 = 224). Is this usual for iPhones? Are there other possible magic byte strings used in JPG files? Edit: found this useful list: http://www.garykessler.net/library/file_sigs.html 回答1: They seem to indicate a sub category of JPEG in some way. What I have