final = decimal; figure('Name','Final EMBEDED Image'),imshow(final); [image path] = uiputfile({'*.jpg';'*.bmp';'*.tif'},'Save Encoded File As');   final is the altered image. I have to store that image by giving the path and name of the image dynamically. for this i have tried uiputfile. the function is working but not serving the purpose.
123938
I want to read an image into MATLAB, draw a rectangle on it, and then save the image.  Also, I'm just learning MATLAB--please be gentle. It seems like it should be simple, but I can't seem to do it.  im = imread('image.tif'); imshow(im); rectangle('Position', [100, 100, 10, 10]); imwrite(im, 'image2.tif');   Even though I can see the rectangle on the image, the saved image does not display the rectangle. How can I save the image and have the rectangle show up?  FWIW, I've already tried saveas(), but that gives me a HUGE image. Is there a way to use saveas() and make the saved image the correct size?
29024
I have a custom content type to allow users to upload images.  I'm trying to keep the interface as simple as possible.  The content type contains a single image field.  This works, but some users don't understand that the image has been uploaded because they don't see it after selecting (to preview the upload, the upload button must be pressed).  Is there a way to skip/automatically press the upload button so that an image is shown immediately after a file is selected?  In other words, immediately after selecting a file, instead of the following picture (where the path is shown but hard to read in Firefox):    I'd like the preview display to be shown like this:
114872
I'm loading an image from a file, and I want to know how to validate the image before it is fully read from the file.  string filePath = "image.jpg"; Image newImage = Image.FromFile(filePath);   The problem occurs when image.jpg isn't really a jpg.  For example, if I create an empty text file and rename it to image.jpg, an OutOfMemory Exception  will be thrown when image.jpg is loaded.  I'm looking for a function that will validate an image given a stream or a file path of the image.  Example function prototype  bool IsValidImage(string fileName); bool IsValidImage(Stream imageStream);
66828
In order to insert an image in LaTeX, I do as follows, but I get an error telling that the file 'me.jpg' is not found.  Where should I save my image files to do this?   \documentclass{article} \usepackage{graphicx} \begin{document} \begin{figure}[h]    \centering   \includegraphics[width=0.2\textwidth]{me.jpg}   \caption{Some figure} \end{figure} \end{document}
108031
Let's say one creates a file like so:  touch myFile   You enter some text in it with vim or whatever, and then use cat myFile to spit the contents out into the terminal.  Now, what happens when I use cat on any image?  Say,  cat myPNG.png   I just get a bunch of garbage.  It just made me think about what the cat command is attempting to do, and where all of this "garbage" comes from.  Just curious.
112802
i've got some binary data which i want to save as an image. When i try to save the image, it throws an exception if the memory stream used to create the image, was closed before the save. The reason i do this is because i'm dynamically creating images and as such .. i need to use a memory stream.  this is the code:  [TestMethod] public void TestMethod1() {     // Grab the binary data.     byte[] data = File.ReadAllBytes("Chick.jpg");      // Read in the data but do not close, before using the stream.     Stream originalBinaryDataStream = new MemoryStream(data);     Bitmap image = new Bitmap(originalBinaryDataStream);     image.Save(@"c:\test.jpg");     originalBinaryDataStream.Dispose();      // Now lets use a nice dispose, etc...     Bitmap2 image2;     using (Stream originalBinaryDataStream2 = new MemoryStream(data))     {         image2 = new Bitmap(originalBinaryDataStream2);     }      image2.Save(@"C:\temp\pewpew.jpg"); // This throws the GDI+ exception. }   Does anyone have any suggestions to how i could save an image with the stream closed? I cannot rely on the developers to remember to close the stream after the image is saved. In fact, the developer would have NO IDEA that the image was generated using a memory stream (because it happens in some other code, elsewhere).  I'm really confused :(
62801
The result of \pgfmathparse is automatically stored in \pgfmathresult. Is it possible to store it in an other variable, too?
93609
Hey having some trouble trying to maintain transparency on a png when i create a thumbnail from it, anyone any experience with this? any help would be great, here's what i am currently doing:  $fileName= "../js/ajaxupload/tees/".$fileName;  list($width, $height) = getimagesize($fileName);  $newwidth = 257; $newheight = 197;  $thumb = imagecreatetruecolor($newwidth, $newheight); imagealphablending($thumb, true); $source = imagecreatefrompng($fileName); imagealphablending($source, true);  imagecopyresized($thumb, $source, 0, 0, 0, 0, $newwidth, $newheight, $width, $height);  imagesavealpha($thumb, true); imagepng($thumb,$newFilename);
100510
So this is probably a simple solve and most likely due to me adding a setting that I shouldn't have.  So for all of my other animations I have done, I render each step as a PNG image and then use the Image Sequencer to render the final animation, and it works well. But this time around, all of the rendered images are not saved as PNGs but rather saved without a file type but can still be opened via Chrome.  Any ideas how I can get Blender to save these renders as a PNG?  Specs: GeForce GTX 1060 3GB, Windows 10, intel i7, 8GB RAM, Blender 2.79
48962
I was reading a few articles about how people saved their working files and it got me thinking about my own method. I used to save everything as a PSD, but recently I have started saving my working files as TIFF's. I use Windows, so I don't know if it's different for Apple users but with a PSD, all I can see is that "PSD" icon. But a TIFF file shows up as a normal image (that I can edit), so I found it really great when I have a lot of working files for one project and could just quickly preview it without opening the program.  That being said, I am no expert in which method is better. And I know a lot of people here are pretty seasoned users in all things Adobe, so I was wondering what your two cent on the whole topic is?   Is there really any difference to saving it as a PSD or TIFF? Is there something I should specifically know about saving my files as a TIFF rather than a PSD?
67792
I used to save images as usual image file formats (jpg, png) by pressing Ctrl+S or Ctrl+Shift+S (Save or Save As dialog). Now in version 2.8 GIMP doesn't allow it anymore: you can Save only as .xcf but to save as .jpg or .png you must Export.  Is there a way to get this old file saving functionality back?
31977
I've got some code that resizes an image so I can get a scaled chunk of the center of the image - I use this to take a UIImage and return a small, square representation of an image, similar to what's seen in the album view of the Photos app. (I know I could use a UIImageView and adjust the crop mode to achieve the same results, but these images are sometimes displayed in UIWebViews).  I've started to notice some crashes in this code and I'm a bit stumped. I've got two different theories and I'm wondering if either is on-base.  Theory 1) I achieve the cropping by drawing into an offscreen image context of my target size. Since I want the center portion of the image, I set the CGRect argument passed to drawInRect to something that's larger than the bounds of my image context. I was hoping this was Kosher, but am I instead attempting to draw over other memory that I shouldn't be touching?  Theory 2) I'm doing all of this in a background thread. I know there are portions of UIKit that are restricted to the main thread. I was assuming / hoping that drawing to an offscreen view wasn't one of these. Am I wrong?  (Oh, how I miss NSImage's drawInRect:fromRect:operation:fraction: method.)
105999
Traditionally  at the end of a filename after uploading it via the image uploader. That doesn't seem to work any more. I've tested it on Q&amp;A as well as chat.        (Yes, I know big M doesn't work)  Could we have this fixed please?
44153
What is the simplest way to access the data in a raw file before demosaicing and write it to a more widely supported file format (e.g. 16 bit TIFF)?  I'm looking to obtain a single channel image where each pixel corresponds to a single pixel on the sensor (regardless of what colour filter it had in front).  The not so simple way would be digging into some open source RAW processing libraries and using code from there.  Is there a simpler way (e.g. a command line tool)?
32800
I have a UIImage (Cocoa Touch). From that, I'm happy to get a CGImage or anything else you'd like that's available. I'd like to write this function:  - (int)getRGBAFromImage:(UIImage *)image atX:(int)xx andY:(int)yy {   // [...]   // What do I want to read about to help   // me fill in this bit, here?   // [...]    int result = (red &lt;&lt; 24) | (green &lt;&lt; 16) | (blue &lt;&lt; 8) | alpha;   return result; }
15052
There several types of graphics files. In no particular order .jpeg .eps .pdf .png .tif .jif (and no doubt others). Some work with latex, dvips and some work with pdflatex. How am I supposed to know which?  Just to confuse matters, metapost produces .eps but I can use these with pdflatex as long as I put in a four line incantation.  Can anyone explain this?
11747
I know how to . Now I would like to automate that based on EXIF data. I already have exiftool installed, but looks like it can only read the data, but can not rotate the image.  There is . But I'm looking for possible solutions using OSX.