PDA

View Full Version : can I change the DPI on a picture



Frank barry
02-01-2015, 6:16 AM
Good morning all, first of all I want to say thank you to everyone for their help

Question...I have lots of pictures but they have a low DPI (76) I can take them into Photoshop, save them from there with a higher DPI (300 / 600). I am wondering if this really changes them?
Cheers
Frank

Mike Null
02-01-2015, 7:50 AM
Frank

I'm less than expert here but a low dpi photo is just that. There are times when you must use them and my practice is to re-sample them before editing. That is to increase the dpi using Corel Photopaint or CS6.

If you are trying to enlarge an image with this process you will be disappointed but it may be helpful in making the photo more engravable or printable. It is a poor substitute for a high res image.

Chris Corwin
02-01-2015, 9:22 AM
Your best result for adding pixels to an image would be to make it blurrier. You can't add definition to a digital picture that didn't have it in the first place. I have rejected a lot of pictures over the past 4 years from people with crappy phone Picts.

I have set up a demonstration with a phone pict engraving and the same subject with a good dslr engraving to show the difference. Some people are ok with crap too. I just don't like making it.

Sam Murdoch
02-01-2015, 9:44 AM
Your best result for adding pixels to an image would be to make it blurrier. You can't add definition to a digital picture that didn't have it in the first place.

That's the truth!

Junior hall
02-01-2015, 10:49 AM
I was told the best way is to make sure that what your going to engrave vector is to make sure that the picture is at least 2mg or better 3mg is even better Also what others have said make it blurry I found making sure the picture is at least 2mg then vectoring it

Scott Shepherd
02-01-2015, 11:13 AM
I was told the best way is to make sure that what your going to engrave vector is to make sure that the picture is at least 2mg or better 3mg is even better Also what others have said make it blurry I found making sure the picture is at least 2mg then vectoring it

That has nothing to do with any of it. You'd have to know the size you want to engrave it, along with the contrast before being able to give any numbers. A 2MB file size might be fine if it's a 3" x 3" photo, but if it's a 12" x 12", then it's not. Not to mention the colors in it. White and black take different amount of space, so a white graphic and black graphic will be two totally different sizes.

It's not that simple, by any means.

Ross Moshinsky
02-01-2015, 1:28 PM
This topic is very confusing for most because people often use terms that shouldn't. DPI really doesn't exist in digital art. When you assign DPI to an image, it's actually just metadata which scales the image in software. The reality is, the image only has pixels. So when talking about digital artwork, you care about resolution (pixels) and quality.

Remember, a 9000x9000 100DPI image is exactly the same as a 9000x9000 300DPI image. The only difference is the 9000x9000 100DPI image will import into Corel/Illustrator/whatever will appear 3x the size. Scale is down 300% and the images will be exactly the same.

Rich Harman
02-01-2015, 4:30 PM
White and black take different amount of space, so a white graphic and black graphic will be two totally different sizes.


I've never heard of black taking more space than white, or vice versa. I would need proof before accepting that as fact.

In an image each pixel is represented by a binary number that contains a certain number of bits (8, 16, or 24 are common). White will have a different value than black but the numbers will use the same quantity of bits - space taken up is the same.

Clark Pace
02-01-2015, 4:52 PM
I've never heard of black taking more space than white, or vice versa. I would need proof before accepting that as fact.

In an image each pixel is represented by a binary number that contains a certain number of bits (8, 16, or 24 are common). White will have a different value than black but the numbers will use the same quantity of bits - space taken up is the same.

Easy to a test. Make a 2 color image(black and white). Save it, then invert the image, save it again, and see which one takes more memory.

Kevin Nathanson
02-01-2015, 5:21 PM
Easy to a test. Make a 2 color image(black and white). Save it, then invert the image, save it again, and see which one takes more memory.

I'm not an engraver, but I was the director of technology for the world's largest printing company, and a group product manager at Adobe, where part of my responsibility was the imaging engine of Photoshop.

There is no difference in file size based on color value for an uncompressed file. The bit rate of the image (8bit (grayscale) 24bit (RGB color) or higher (HDR color and a few other fancy technical things like alpha channels, etc.) are constant, with each pixel being described by that number of bits. Files that are compressed with lossy compression (you know them as JPGs and PNGs) can vary based not on the color value but rather the sequencing of colors, as part of the compression algorithm is a process called run-length encoding, which takes into consideration the span of like or similar colors.

The latest version of Photoshop does a pretty amazing job of interpolation and sharpening in order to "res-up" files that are lacking in pixel content. This of course depends on the quality and sharpness of the source image.

K

Scott Shepherd
02-01-2015, 6:38 PM
I've never heard of black taking more space than white, or vice versa. I would need proof before accepting that as fact.



Simple enough, take a digital camera, take photos with a lot of white in them and photos with a lot of black in them and look at the photo size. If it wasn't true, then every single photo you took would all be the same file size, which they aren't. The binary difference between representing white and black is quite different.

I agree, Photoshop files will be the same size, but photos aren't photoshop files.

Scott Shepherd
02-01-2015, 7:06 PM
Kevin, lasers are only black or white. They don't see color.

Rich Harman
02-01-2015, 7:09 PM
Simple enough, take a digital camera, take photos with a lot of white in them and photos with a lot of black in them and look at the photo size. If it wasn't true, then every single photo you took would all be the same file size, which they aren't. The binary difference between representing white and black is quite different.


I don't believe that the binary representation of black vs white occupies any difference in space. And photos taken with a camera are different sizes due to compression and the amount of detail in the photo.

Probably the reason that a dark photo takes more space is because it is not truly all black. It is many different shades of dark gray. Us an image editing program to adjust the levels and you will see lots of hidden detail emerge. Whilst a white photo, considered to be "blown out" can be nothing but white.

The pixels in a camera's image sensor are like little buckets that collect light. True black is when one of the buckets catches no photons at all - which nearly never happens. Even with the lens cap on the photo sites can collect some photons just from the heat of the electronics inside (noise). However, when the buckets fill up, such as when over exposed, well once it is full - it is full. Any additional photons won't make any difference - that is when you get pure white. So what you may see as black really is many, many shades of grey.

Jerome Stanek
02-01-2015, 7:10 PM
Simple enough, take a digital camera, take photos with a lot of white in them and photos with a lot of black in them and look at the photo size. If it wasn't true, then every single photo you took would all be the same file size, which they aren't. The binary difference between representing white and black is quite different.

I agree, Photoshop files will be the same size, but photos aren't photoshop files.

That is not an exact way of finding anything out I can take a picture with a lot of white an very little black but have a lot of other colors in there. The only way would be the exact same black and white picture but with reversed image sort of like an M C Escher drawing

Rich Harman
02-01-2015, 7:20 PM
Some more about colors and space they take up. Each pixel is composed of Red Green And Blue. In 24 bit color each of the colors will have a byte assigned to them.

That means that there are 256 levels of Red, 256 levels of Green and 256 levels of Blue in every pixel. Every pixel is described using three bytes, regardless of what color it is.

Pure black would have the lowest levels of each of Red Green and Blue which would be represented as zero's. 00000000 00000000 00000000. Pure white would be the highest value for each of the colors (255) - 11111111 11111111 11111111. Both Black and White use the same number of bits - they take the same amount of space on a hard drive.

Scott Shepherd
02-01-2015, 7:44 PM
I don't believe that the binary representation of black vs white occupies any difference in space. And photos taken with a camera are different sizes due to compression and the amount of detail in the photo.

That's incorrect, the binary numbers of black and white have been different since day one. That's how data is stored, it's math. This isn't a new concept, it's always been that way.

Black always creates a larger file size than white. Always. It's impossible to create a white file that's the same as black and not have it be smaller.

Scott Shepherd
02-01-2015, 7:46 PM
Laser don't see color Rich. An all white jpeg and an all white jpeg will be different file sizes because of the way the white and black are stored. Again, this isn't new, it's been this way from the beginning.

Rich Harman
02-01-2015, 7:49 PM
That's incorrect, the binary numbers of black and white have been different since day one. That's how data is stored, it's math. This isn't a new concept, it's always been that way.

Black always creates a larger file size than white. Always. It's impossible to create a white file that's the same as black and not have it be smaller.

Yes the numbers are different but they do not take up a different amount of space. A binary zero takes the same space as a binary one. It has been that way since day one as you say. Search for RGB color table for more info.

Here's a link to one. http://www.rapidtables.com/web/color/RGB_Color.htm You can see from the table, or the color picker, that every color is represented by three bytes. The number of bytes shall be three, regardless of color. All bytes have eight bits - no exceptions. The value contained in each byte can be anywhere from zero to 255, but the space taken is exactly the same.

Scott Shepherd
02-01-2015, 8:07 PM
That's not true Rich. Take a photo of a white piece of paper and one of a black piece of paper, same size photo. The sizes will be drastically different. White has ALWAYS taken less space than black. Always.

Rich Harman
02-01-2015, 8:14 PM
That's not true Rich. Take a photo of a white piece of paper and one of a black piece of paper, same size photo. The sizes will be drastically different. White has ALWAYS taken less space than black. Always.

It's impossible to create a white file that's the same as black and not have it be smaller.

Okay, here is what I did;

Using my Nikon D7000 I set the ISO to 100, shutter speed to 1/8000 and snapped a picture with the lens cap on. I figured that would be the darkest I could make a picture.

Then I set the shutter speed to 8 seconds, f3.5 and took a photo of a white piece of paper under a light.

The result is that both images were exactly 380K*.

I have cropped them both to 300x300, and now they are each 10K or 10,056 bytes to be exact.

I have added both images to this post but the white one is hard to see. As they appear inline (thumbnails) they are each exactly 1,364 bytes.

305752305753

The exact size of the original black image was 380,295 bytes and the white image was 380,289 bytes. The black was 6 bytes larger than the white (a difference of .0016%), most likely due to there being a few non black pixels in there.

Glen Monaghan
02-01-2015, 9:55 PM
Scott et al,

I'm certainly not an expert on JPEG, but JPEG doesn't have a specific representation for black, white, or any other color because it changes image representations as a means to reducing storage (or transmission) size.

The JPEG process encodes an image with a lossy form of compression based on the discrete cosine transform (DCT). This transformation converts the original image from a spatial representation (2D or X-Y of RGB values) into the frequency domain. (This is sort of a 2 dimensional version of running a Fourier transform on a waveform to get the frequency components. For a pure sine wave, you get a single value that indicates the wave's amplitude at its fundamental frequency. For something like a square wave, you get a series of values that are amplitudes of harmonics at odd multiples of the square wave's fundamental frequency.) The JPEG process then discards high-frequency (fast transitioning) brightness and hue coefficients, and quantizes or bins the results. (This is analogous to taking the Fourier of that square wave, producing an infinite sequence of harmonic values, and then throwing away most of the higher harmonics; if you do it carefully, you still get an arbitrarily close approximation of a square wave when you convert back to the spatial domain, but you don't need near as much data to encode the approximated waveform as the perfect waveform. JPEG does this in 2 dimensions.) The quantized coefficients are then sequenced and packed into the JPEG version of the image. Most implementations of JPEG permit the user to specify the compression-ratio so as to trade off picture-quality for smaller file size, but there is no specific color representation in the file.

Black images or white images don't affect file size (at least not that you would notice) but fine details and high contrast definitely do. I just created two 300x300 images, one all black (RGB=0,0,0) and one all white (RGB=255,255,255) and saved with minimal compression, YCbCr 2x2, 1x1, 1x1. Each is 7KB in size. When I drew a thin, squiggly black line through the white image and saved the same way, it came out 42KB. I then took the negative of that image (creating a squiggly white line on a mostly black image) and the result was again 42KB.

Chris Corwin
02-01-2015, 10:14 PM
I'm waiting for someone to quote Wikipedia ....

Art Mann
02-01-2015, 11:31 PM
The size of a JPEG file is dependent on the complexity of the image, the numbers of colors and the degree of compression. The actual color is irrelevant. There is no complexity in either an all white or all black image. Therefore, as Glen just observed, the files will be quite small. On the other hand, a picture of a leafy tree with lots of complex details and colors, for example, will require a much, much larger file. A TIF file is an uncompressed image with no loss of detail. This type image takes a huge amount of space but the files of every image taken with the same resolution and color depth are the same size. Please realize that nearly all cheap cameras and phone cameras will only save a JPG image because the designers prioritize small file size above above versatility and image quality. That is why so many people make erroneous assumptions about image file sizes. The more expensive cameras with large sensors will always provide a file format with huge files and little or no compression as an option. These files are usually referred to as RAW. There are RAW viewers but people typically generate a JPG file from the RAW one for printing and distribution. That is the way I do it.

As someone posted very early on, the number of dots per inch is totally irrelevant. Any good photo editor is capable of modifying the image to whatever DPI you like with no loss of information. The only thing that matters is the number of pixels in the X and Y directions and the color depth.

Dan Hintz
02-02-2015, 7:10 AM
Man, I step away for the weekend and all kinds of fun discussions happen... ;)

Theoretically, there should be no difference in file size between a black/white image and it's inverse (no matter how much black or white is in the image). In a raw format, every color is stored as a constant number of bits (e.g., black is 0x00 and white is 0xFF... or 0 and 255, if you're not a hexadecimal kinda guy).

In a compressed format (e.g., JPEG, RLE, etc.), the number of bits representing each pixel can vary. Without specific compression options enabled, this means one image and its inverse will compress in exactly the same way. It gets a bit more interesting when certain options are enabled, such as using specific look-up tables (LUT)... if the LUT for an image is used on its inverse, the file size can grow significantly, but this is rarely done.

Mike Null
02-02-2015, 10:10 AM
The OP asked how to turn on the lights and you guys are telling him how to build a generator.;)

Richard Rumancik
02-02-2015, 11:26 AM
Yes, Mike, twenty-something responses and only the first couple actually had anything to do with the question . . .

Frank, Jeffrey Dewing asked a similar question in his post "Resolution, DPI & PPI" here:

http://www.sawmillcreek.org/showthread.php?227004-Resolution-DPI-amp-PPI

I attempted an answer to his question but it is related to PhotoPaint, not PhotoShop. But there are probably similar parameters in PhotoShop that do the same thing. So the answer to whether it is really changing the data file, or just a header associated with the file, depends on how you do the resample in PhotoShop. If you lock the file size when resampling, something else has to change, and that would be the resulting dimensions (if plotted on a output device/printer using that dpi). The "quality" of the file will be identical, as it contains the same pixel information.

If you don't lock the file size, then you are really asking it to do interpolation to add pixels. This will not make the file look better as it has to interpolate the intermediate pixels. So the file will be larger but the quality poor because it is interpolating missing information.

I don't know what the terms are in PhotoShop but you can probably figure them out in your resample dialog or maybe a PhotoShop user can help here.

If the 76 dpi file is from your camera and it is a high-quality image, then you can change the file header using PhotoShop so it will display output info at the new resolution. The expected output dimensions will decrease. I usually do this if I am lasering a photo as it helps me keep things straight. You have not really changed the image data in this case.

If you are trying to improve a cell-phone picture by increasing the resolution that is a different scenerio altogether. Sow's ears and silk purses come to mind.

Dan Hintz
02-02-2015, 12:11 PM
To tack onto Richard's comments (and this probably goes better in the other thread mentioned)...

Since the 72dpi tag is truly just metadata (I believe this was mentioned elsewhere), one could literally go into the file and delete the few bytes that specify the tag. Opening the image would show no change whatsoever, but programs like Photoshop will likely default to "72dpi" if it does not recognize a dpi tag in the file. It's a (practically) pointless number for the average user, doing little more than confusing the issue.

Richard Rumancik
02-02-2015, 12:20 PM
Dan, you are right - the dpi number is rather pointless embedded in the photo file because it tells you something about your printer/laser/output device, and not a parameter of the camera or the file itself. I guess they had reasons but people will often identify a photo file as a "72 dpi file" - implying it is a low-resolution file - when in fact it might be a 10MB file with more data in there than you can possibly use.

Art Mann
02-02-2015, 12:38 PM
The dots per inch designation was created back when digital photos were produced by scanning a photograph on a flat bed or drum scanner. The scanners themselves scanned at a certain number of dots per inch. The resultant file needed to include DPI so you could scale the output image to exact size or a percentage of exact size for output. That was state of the art technology when my wife began her career as a digital graphics designer. The file format stuck even though digital cameras now capture virtually all digital images and the DPI has no meaning.

Dan Hintz
02-02-2015, 1:29 PM
The dots per inch designation was created back when digital photos were produced by scanning a photograph on a flat bed or drum scanner. The scanners themselves scanned at a certain number of dots per inch. The resultant file needed to include DPI so you could scale the output image to exact size or a percentage of exact size for output. That was state of the art technology when my wife began her career as a digital graphics designer. The file format stuck even though digital cameras now capture virtually all digital images and the DPI has no meaning.

Art,

I thought that was LPI (as in when drum scanners first started storming the scene), not DPI...?

Art Mann
02-02-2015, 2:45 PM
Dan, now you are going really far back. We used to hire a local company to do drum scanning for advertising photos but the files always came back as uncompressed TIF files. The files were created by mounting the print on a rapidly rotating drum and scanning one row of pixels at a time while moving the scan head across the drum. They probably had some file format that output the line scan data. If I recall correctly, you specified the scan resolution you wanted in LPI.

Edit: JPEG files were derived from TIF files with the color information (or more often gray scale data in those days) compressed but the header information the same stuff.

Bill Carruthers
02-02-2015, 4:27 PM
The OP asked how to turn on the lights and you guys are telling him how to build a generator.;)
Just got to love this line Mike:D

Steve Morris
02-02-2015, 4:39 PM
think I just walked into a ------ contest :p

Scott Shepherd
02-02-2015, 6:57 PM
Okay, here is what I did;

Using my Nikon D7000 I set the ISO to 100, shutter speed to 1/8000 and snapped a picture with the lens cap on. I figured that would be the darkest I could make a picture.

Then I set the shutter speed to 8 seconds, f3.5 and took a photo of a white piece of paper under a light.

The result is that both images were exactly 380K*.

The exact size of the original black image was 380,295 bytes and the white image was 380,289 bytes. The black was 6 bytes larger than the white (a difference of .0016%), most likely due to there being a few non black pixels in there.

And that would not be the results I got. Here's the file size differences between black and white, two different samples done, same results both times.

The white is actually larger than the black, so I had that backwards. In both cases, the two white photos were really close to being the same size and the two black were really close to being the same size as each other, but the white and black were very different in files sizes, as shown in the data from the two tests below.

305863305864

Dan Hintz
02-02-2015, 7:29 PM
And that would not be the results I got. Here's the file size differences between black and white, two different samples done, same results both times.

The white is actually larger than the black, so I had that backwards. In both cases, the two white photos were really close to being the same size and the two black were really close to being the same size as each other, but the white and black were very different in files sizes, as shown in the data from the two tests below.

305863305864
How did you take the white photo? It's important.

A black photo is easy... as done previously, keep the lens cap on. Except for light leakage around the cap, that's pretty straightforward black. That will compress quite well as all values are at (or VERY near) black level. White, on the other hand, is rarely pure white (much more difficult to create a pure white image naturally). It will tend to have a lot of less-than-white speckles throughout... and every little speckle will lead to a drop in compression efficiency (i.e., bigger file).

That said, the difference in file size you're showing seems way out of place.

Scott Shepherd
02-02-2015, 8:02 PM
How did you take the white photo? It's important.

A black photo is easy... as done previously, keep the lens cap on. Except for light leakage around the cap, that's pretty straightforward black. That will compress quite well as all values are at (or VERY near) black level. White, on the other hand, is rarely pure white (much more difficult to create a pure white image naturally). It will tend to have a lot of less-than-white speckles throughout... and every little speckle will lead to a drop in compression efficiency (i.e., bigger file).

That said, the difference in file size you're showing seems way out of place.

Oh, I'm sure it's not "pure" white, but it's the best I can do. I took a white sheet of Rowmark, took a photographers light placed it right by it, cranked it up to wide open, and took the photo. That's about all I can do.

I think the light is 5,000K.

Doesn't really matter. My original point was that you can't tell someone that a "X" file size is appropriate for laser engraving because it's much more to it than that.

Rich Harman
02-02-2015, 8:05 PM
You could open the photo in a photo editor and examine the pixels to see the variations in color. I am sure you would find a greater variation in color in one of the photos. However, I think the evidence is irrefutable. I have posted images that you can download and examine yourself that are exactly the same size.

Many people have joined me in saying (essentially) that it is not the color that determines file sizes, but the amount of detail in the photos. More detail (colors) = larger file size. Keep in mind that you may not be able to detect the detail with the naked eye.

I disagree with Dan, I think it is far easier to make pure white than pure black. Pure white is the result of overexposure - and that is really easy to do. Although, if you allow the camera to to set the exposure for a white scene, then yeah it will try not to overexpose so you would be likely to get many colors that are close to white. A properly exposed photo of a piece of white paper will have very few pure white pixels.

I am confident that I can take pairs of black and white photos that appear to be sold black or solid white while intentionally making either one have a larger file size by changing the way in which I expose them.

Rich Harman
02-02-2015, 8:07 PM
Doesn't really matter. My original point was that you can't tell someone that a "X" file size is appropriate for laser engraving because it's much more to it than that.

Absolutely, you also cannot say that "X" file size is inappropriate for engraving - it depends heavily on the amount of detail in the photo.

Frank barry
02-04-2015, 1:46 PM
Hi I just want to say a big thank you to everyone who posted a reply I canít say I understand it all as itís a lot more complex than I taught I must say getting the best out of a laser is more complex than one would expect but I am getting there thanks for the support and advice
Cheers Frank

Bert Kemp
02-04-2015, 3:14 PM
in order to do this you'd have to be in a lab environment. The camera would have to have exact same settings, and be exactly, same distance from the subject, you'd have to have exactly the same amount of light. But the fact remains its still not a fair comparison and cameras see things different then the laser and different then a laser.


That's not true Rich. Take a photo of a white piece of paper and one of a black piece of paper, same size photo. The sizes will be drastically different. White has ALWAYS taken less space than black. Always.