YOUR ACCOUNT

Login or Register to post new topics or replies
SpaceRay
SpaceRay

Posts: 12298
Filters: 35
I by chance found that many people think that if you have, for example, a 10 megapixel photo and the resize it and enlarge the resolution to the double of the pixels size you would get a 20 Megapixels photo.

Doubling the size of the pixels of a 10 megapixel photo will you get a 20 megapixel photo?

Do you think that this is true or not?


I already know the right answer, and have already tested it myself, I ask this now here to see what you and others think and believe, and if you are aware of this or not.

If you do not knopw already the answer and want to test it here is the megapixels calculator to test it yourself. Double the size of the pixels shown and the multiply this two numbers and see if the final results is the double of the megapixels smile:)
  Details E-Mail
Skybase
2D/3D Generalist

Posts: 4025
Filters: 76
This can be thought of in two ways. One is that you think it from a technical side. When you expand image resolution in any program you are adding more pixels to the output. Therefore, if you add more pixels to your final output the larger your megapixel count.

However, if you're doubling an image, this means you're basically "stretching" pixels out using various filter processes. So while a high megapixel count indicates a larger image, therefore "high quality", your actual image is being stretched out and becomes blurrier provided the original image doesn't have every detail to fill 2x its size.

Simply put: you can't get 2x more clarity by scaling it 2x. But the numbers will go up anyway because MP is just a measure.
  Details E-Mail
SpaceRay
SpaceRay

Posts: 12298
Filters: 35
Funny how a simple an easy question and answer you have converted it in a complex one smile;) smile:D

Quote
Skybase

This can be thought of in two ways. One is that you think it from a technical side


Yes, is true that this can be thought also from the technical point of view, but what I asking is a more simple question from the other side, I mean not technical, just mathematical and real world.

Would you get a 20 megapixels photo when you resize in double a 10 megapixels photo?

Or seen in another way, are the Megapixels equal to the size resolution in Pixels?


I mean that, if the megapixels will increase in the same proportion as the pixels of the image?

I could have put already the answer, but I want to know if any other knows it.

Also I can say that do not get confused by the Megapixel count of digital cameras and the megapixel count of photos or images, although they are the same, there are ways to modify the results with software, so the megapixels are true even when they are NOT the same as the ones from the camera. If needed will explain later.

Definition of Megapixel here, search for the megapixel below in the article

Quote
Skybase

Therefore, if you add more pixels to your final output the larger your megapixel count.

However, if you're doubling an image, this means you're basically "stretching" pixels out using various filter processes


Following the technical point of view you have shown, I agree and you are right, if you add more pixels to the image, this will rise the the megapixel count smile:) but how much ? in what proportion? if you double the amount of pixels available will you get the double of megapixels?

Sorry that I do not understand what you mean with "stretching pixels" ? smile:?:

As far as I know the only way to add more pixels to an image, or resize it is with Interpolation

Quote
In the mathematical field of numerical analysis, interpolation is a method of constructing new data points within the range of a discrete set of known data points.


The are many math ways to do this interpolation (as shown in the link) as also more than those shown are there is also fractal interpoolation and more than this in recently new resizing softwares.

Quote
Skybase

So while a high megapixel count indicates a larger image, therefore "high quality", your actual image is being stretched out and becomes blurrier provided the original image doesn't have every detail to fill 2x its size.

Simply put: you can't get 2x more clarity by scaling it 2x. But the numbers will go up anyway because MP is just a measure.


A high megapixel count is true that indicates a large image or higher resolution, BUT I have to disagree that it means also "high quality" or more clarity, the megapixel count is not directly related to the quality as far as I know, because a megapixel is just a number and also depends HOW you have got all those pixels.

A megapixel from a cheap compact camera of a 10 megapixels, does not have the same quality and clarity done the same megapixel from a very expensive full frame sensor DSLR camera. The 10 megapixel from this expensive camera will have better quality and clarity than the 10 megapixels from the cheap compact camera. I have proofs of this and can be found easily in the www.dpreview.com website

ALSO if you have got a 50 Megapixels photo from interpolating a 10 megapixels photo, it will not mean that because it has 5x more megapixels will have more or higher quality at all, as you have right said that it will be a blurried image.


INTERPOLATING WILL NEVER GET YOU A BETTER OR HIGHER QUALITY

As far as I know this is always true, at least from all that I have seen and know

I agree with you that if you resize the original source image, it will get blurrier and loose quality, so as you say very well and is totally true

Quote
you can't get 2x more clarity by scaling it 2x. But the numbers will go up anyway because MP is just a measure


TO END

I have to say that when I have put this thread, was not involved any technical reasons, just a SIMPLE AND EASY question

will you get 2x megapixels when resizing 2x the pixels that the image already have?
  Details E-Mail
Skybase
2D/3D Generalist

Posts: 4025
Filters: 76
Well excuse me for not giving you straight forward answers. smile:|

Quote
will you get 2x megapixels when resizing 2x the pixels that the image already have?


No.

Megapixel = 0.000001(width px * height px)
1024x1024 is about 1 megapixel (1,048,576 px)
512x512 is about 0.26 megapixels (262,144px)

And no, I'm not providing the term "high quality" as a statement defining clarity. I used two separate terms to define output resolution.
  Details E-Mail
xirja
Idididoll Forcabbage

Posts: 1698
Filters: 8
I know that I just read that you wanted, or didn't want, a technical explanation, but I can't recall which one. Hilarious, that I am the arbiter of all truths in the universe and you are not! Do you want to guess my shoe size? Anyhow, maybe the following is unhelpful:

http://en.wikipedia.org/wiki/Lanczos_resampling

In the above article you will find the following:

I can tell you this is true, and you should believe me!

Lanczos resampling or Lanczos filter is a mathematical formula used to smoothly interpolate the value of a digital signal between its samples. It maps each sample of the given signal to a translated and scaled copy of the Lanczos kernel, which is a sinc function windowed by the central hump of a dilated sinc function. The sum of these translated and scaled kernels is then evaluated at the desired points.
Lanczos resampling is typically used to increase the sampling rate of a digital signal, or to shift it by a fraction of the sampling interval). It is often used also for multivariate interpolation, for example to resize or rotate a digital image. It has been considered the "best compromise" among several simple filters for this purpose.[1]
The filter is named after Cornelius Lanczos (Hungarian pronunciation: [ˈlaːntsoʃ]), because of his contributions to the application of Fourier series and Chebyshev polynomials.[2]

Lanczos windows for .


Lanczos kernels for the cases and . Note that the function obtains negative values.
The effect of each input sample on the interpolated values is defined by the filter's reconstruction kernel L(x), called the Lanczos kernel. It is the normalized sinc function sinc(x), windowed (multiplied) by the Lanczos window. or sinc window, which is the central lobe of a horizontally-stretched sinc function sinc(x/a) for  −a ≤ x ≤ a.

Equivalently,

Quote
I love meatballs


If you love meatballs put your finger on your nose and spin around three times.

The parameter a is a positive integer, typically 2 or 3, which determines the size of the kernel. The Lanczos kernel has 2a − 1 lobes, a positive one at the center and a − 1 alternating negative and positive lobes on each side.
[edit]
Interpolation formula
Given a one-dimensional signal with samples si, for integer values of i, the value S(x) interpolated at an arbitrary real argument x is obtained by the discrete convolution of those samples with the Lanczos kernel;[3] namely,

where a is the filter size parameter. The bounds of this sum are such that the kernel is zero outside of them.
[edit]
Properties
As long as the parameter a is a positive integer, the Lanczos kernel is continuous everywhere, and its derivative is defined and continuous everywhere (even at x = ±a, where both sinc functions go to zero). Therefore, the reconstructed signal S(x) too will be continuous, with continuous derivative.
The Lanczos kernel is zero at every integer argument x, except at x = 0, where it has value 1. Therefore, the reconstructed signal exactly inperpolates the given samples: we will have S(x) = si for every integer argument x = i.
[edit]
Multidimensional interpolation


Incipit of a piece by Gaspar Sanz. Original, low quality expansion with JPEG artifacts. Open the picture to see the details.


The same image resampled to five times as many samples in each direction, using Lanczos resampling. Pixelation artifacts were removed changing the image's transfer function. Open the picture to see the details.
Lanczos filter's kernel in two dimensions is simply the product of two one-dimensional kernels:[3][dubious – discuss]

Given a two-dimensional signal sij defined at integer points (i,j) of the plane (e.g. intensities of pixels in a digital image), the reconstructed function is

When resampling a two-dimensional signal at regularly spaced points (x,y), one can save some computation by resampling the entire signal along a single axis, then resampling the resulting two-dimensional signal along the other axis.
These formulas generalize to signals with three or more dimensions, in the obvious way.
[edit]
Evaluation
[edit]
Advantages

Quote
I love meatball sandwiches


Hug yourself now if you like me.

A discrete Lanczos window and its frequency response; see Window function for comparison with other windows.
The theoretically optimal reconstruction filter for band-limited signals is the sinc filter, which has infinite support. The Lanczos filter is one of many practical (finitely supported) approximations of the sinc filter. Each interpolated value is the weighted sum of 2a consecutive input samples. Thus, by varying the 2a parameter one may trade computation speed for improved frequency response. The parameter also allows one to choose between a smoother interpolation or a preservation of sharp transients in the data. For image processing, the tradeoff is between the reduction of aliasing artifacts and the preservation of sharp edges.
The Lanczos filter has been compared with other interpolation methods for discrete signals, particularly other windowed versions of the sinc filter. Turkowski and Gabriel claimed that the Lanczos filter (with a= 2) the "best compromise in terms of reduction of aliasing, sharpness, and minimal ringing", compared with truncated sinc and the Bartlett, cosine-, and Hann-windowed sinc, for decimation and interpolation of 2-dimensional image data.[1] According to Jim Blinn, the Lanczos kernel (with a=3) "keeps low frequencies and rejects high frequencies better than any (achievable) filter we've seen so far."[4]
Lanczos interpolation is a popular filter for "upscaling" videos in various media utilities, such as AviSynth[5] and FFmpeg.[6]
[edit]
Limitations

Quote
meatballs are sometimes made of horse


human racehorses are fun to watch run.

Since the kernel assumes negative values for a > 1, the interpolated signal can be negative even if all samples are positive. More generally, the range of values of the interpolated signal may be wider than the range spanned by the discrete sample values. In particular, there may be ringing artifacts just before and after abrupt changes in the sample values, which may lead to clipping artifacts. However, these effects are reduced compared to the (non-windowed) sinc filter.
When using the Lanczos filter for image resampling, the ringing effect will create light and dark halos along any strong edges. While these bands may be visually annoying, they help increase the perceived sharpness, and therefore provide a form of edge enhancement. This may improve the subjective quality of the image, given the special role of edge sharpness in vision.[7]
In some applications, the low-end clipping artifacts can be ameliorated by transforming the data to a logarithmic domain prior to filtering. In this case the interpolated values will be a weighted geometric mean, rather than an arithmetic mean, of the input samples.
The Lanczos kernel does not have the partition of unity property. That is, the sum of all integer-translated copies of the kernel is not always 1. Therefore, the Lanczos interpolation of a discrete signal with constant samples does not yield a constant function. This defect is most evident when a=1. Also, for a=1 the interpolated signal has zero derivative at every integer argument.
[edit]
See also


• Bicubic interpolation
• Bilinear interpolation
• Spline interpolation
• Nearest-neighbor interpolation
• Sinc filter



In mathematics, bicubic interpolation is an extension of cubic interpolation for interpolating data points on a two dimensional regular grid. The interpolated surface is smoother than corresponding surfaces obtained by bilinear interpolation or nearest-neighbor interpolation. Bicubic interpolation can be accomplished using either Lagrange polynomials, cubic splines, or cubic convolution algorithm.
In image processing, bicubic interpolation is often chosen over bilinear interpolation or nearest neighbor in image resampling, when speed is not an issue. In contrast to bilinear interpolation, which only takes 4 pixels (2x2) into account, bicubic interpolation considers 16 pixels (4x4). Images resampled with bicubic interpolation are smoother and have fewer interpolation artifacts.

In mathematics, bilinear interpolation is an extension of linear interpolation for interpolating functions of two variables (e.g., and ) on a regular 2D grid. The interpolated function should not use the term of or , but .
The key idea is to perform linear interpolation first in one direction, and then again in the other direction. Although each step is linear in the sampled values and in the position, the interpolation as a whole is not linear but rather quadratic in the sample location (details below).

In both cases, the number of constants (four) correspond to the number of data points where f is given. The interpolant is linear along lines parallel to either the or the direction, equivalently if or is set constant. Along any other straight line, the interpolant is quadratic.
It has to be noted, however, that even if the interpolation is not linear in the position (x and y), it is linear in the amplitude, as it is apparent fr om the equations above: all the coefficient bj, j=1..4, are proportional to the value of the function f(,).
The result of bilinear interpolation is independent of the order (order here meaning which axis is interpolated first and which second) of interpolation. If we had first performed the linear interpolation in the y-direction and then in the x-direction, the resulting approximation would be the same.
The obvious extension of bilinear interpolation to three dimensions is called trilinear interpolation.
[edit]
Application in image processing

Quote
Horse with asparagus is delicious!

http://www.youtube.com/watch?v=tOVPGlTBknI

In computer vision and image processing, bilinear interpolation is one of the basic resampling techniques.
In texture mapping, it is also known as bilinear filtering or bilinear texture mapping, and it can be used to produce a reasonably realistic image. An algorithm is used to map a screen pixel location to a corresponding point on the texture map. A weighted average of the attributes (color, alpha, etc.) of the four surrounding texels is computed and applied to the screen pixel. This process is repeated for each pixel forming the object being textured.[1]
When an image needs to be scaled up, each pixel of the original image needs to be moved in a certain direction based on the scale constant. However, when scaling up an image by a non-integral scale factor, there are pixels (i.e., holes) that are not assigned appropriate pixel values. In this case, those holes should be assigned appropriate RGB or grayscale values so that the output image does not have non-valued pixels.
Bilinear interpolation can be used where perfect image transformation with pixel matching is impossible, so that one can calculate and assign appropriate intensity values to pixels. Unlike other interpolation techniques such as nearest neighbor interpolation and bicubic interpolation, bilinear interpolation uses only the 4 nearest pixel values which are located in diagonal directions fr om a given pixel in order to find the appropriate color intensity values of that pixel.
Bilinear interpolation considers the closest 2x2 neighborhood of known pixel values surrounding the unknown pixel's computed location. It then takes a weighted average of these 4 pixels to arrive at its final, interpolated value. The weight on each of the 4 pixel values is based on the computed pixel's distance (in 2D space) fr om each of the known points.[2]


Example of bilinear interpolation in grayscale values.
As seen in the example on the right, the intensity value at the pixel computed to be at row 20.2, column 14.5 can be calculated by first linearly interpolating between the values at column 14 and 15 on each rows 20 and 21, giving

and then interpolating linearly between these values, giving

This algorithm reduces some of the visual distortion caused by resizing an image to a non-integral zoom factor, as opposed to nearest neighbor interpolation, which will make some pixels appear larger than others in the resized image. Bilinear interpolation tends, however, to produce a greater number of interpolation artifacts (such as aliasing, blurring, and edge halos) than more computationally demanding techniques such as bicubic interpolation.[3]

In the mathematical field of numerical analysis, spline interpolation is a form of interpolation wh ere the interpolant is a special type of piecewise polynomial called a spline. Spline interpolation is preferred over polynomial interpolation because the interpolation error can be made small even when using low degree polynomials for the spline. Spline interpolation avoids the problem of Runge's phenomenon, which occurs when interpolating between equidistant points with high degree polynomials.

Nearest-neighbor interpolation (also known as proximal interpolation or, in some contexts, point sampling) is a simple method of multivariate interpolation in one or more dimensions.
Interpolation is the problem of approximating the value of a function for a non-given point in some space when given the value of that function in points around (neighboring) that point. The nearest neighbor algorithm selects the value of the nearest point and does not consider the values of neighboring points at all, yielding a piecewise-constant interpolant. The algorithm is very simple to implement and is commonly used (usually along with mipmapping) in real-time 3D rendering to sel ect color values for a textured surface.
[edit]Connection to Voronoi diagram

Quote
Yak with asparagus is also delicious!


But maybe you don't think so, and I'm going to have to spend a lot of time and effort to convince you that you are wrong!

For a given set of points in space, a Voronoi diagram is a decomposition of space into cells, one for each given point, so that anywhere in space, the closest given point is inside the cell. This is equivalent to nearest neighbour interpolation, by assigning the function value at the given point to all the points inside the cell. The figures on the right side show by colour the shape of the cells.

In signal processing, a sinc filter is an idealized filter that removes all frequency components above a given bandwidth, leaves the low frequencies alone, and has linear phase. The filter's impulse response is a sinc function in the time domain, and its frequency response is a rectangular function.
It is an "ideal" low-pass filter in the frequency sense, perfectly passing low frequencies, perfectly cutting high frequencies; and thus may be considered to be a brick-wall filter.
Real-time filters can only approximate this ideal, since an ideal sinc filter (aka rectangular filter) is non-causal and has an infinite delay, but it is commonly found in conceptual demonstrations or proofs, such as the sampling theorem and the Whittaker–Shannon interpolation formula.
In mathematical terms, the desired frequency response is the rectangular function:

wh ere is an arbitrary cutoff frequency (aka bandwidth). The impulse response of such a filter is given by the inverse Fourier transform:

in terms of the normalized sinc function.
As the sinc filter has infinite impulse response in both positive and negative time directions, it must be approximated for real-world (non-abstract) applications; a windowed sinc filter is often used instead. Windowing and truncating a sinc filter kernel in order to use it on any practical real world data set destroys its ideal properties.
Contents [hide]

An idealized electronic filter, one that has full transmission in the pass band, and complete attenuation in the stop band, with abrupt transitions, is known colloquially as a "brick-wall filter", in reference to the shape of the transfer function. The sinc filter is a brick-wall low-pass filter, from which brick-wall band-pass filters and high-pass filters are easily constructed.
The lowpass filter with brick-wall cutoff at frequency BL has impulse response and transfer function given by:


The band-pass filter with lower band edge BL and upper band edge BH is just the difference of two such sinc filters (since the filters are zero phase, their magnitude responses subtract directly):[1]


The high-pass filter with lower band edge BH is just a transparent filter minus a sinc filter, which makes it clear that the Dirac delta function is the lim it of a narrow-in-time sinc filter:


Brick-wall filters that run in realtime are not physically realizable as they have infinite latency (i.e., its compact support in the frequency domain forces its time response not to have compact support meaning that it is ever-lasting) and infinite order (i.e., the response cannot be expressed as a linear differential equation with a finite sum), but approximate implementations are sometimes used and they are frequently called brick-wall filters.[citation needed]
[edit]Frequency-domain sinc

The name "sinc filter" is applied also to the filter shape that is rectangular in time and a sinc function in frequency, as opposed to the ideal low-pass sinc filter, which is sinc in time and rectangular in frequency. In case of confusion, one may refer to these as sinc-in-frequency and sinc-in-time, according to which domain the filter is sinc in.
Sinc-in-frequency CIC filters, among many other applications, are almost universally used for decimating delta-sigma ADCs, as they are easy to implement and nearly optimal for this use.[2]


And in conclusion,

A 4 lb. GMO carrot stick for the greatest number of posts/month!

and next,

2 lbs. elk(moose(horse(buffalo(yak)))) steak for the greatest length/post!



smile:bunny:

Try this quick and easy calculator to determine your Ascendant. An accurate birth time is required. Be sure to read our interpretations of your Ascendant here.

http://www.cafeastrology.com/ascendantcalculator.html

Quote
Try this quick and easy calculator to determine your Ascendant. An accurate birth time is required. Be sure to read our interpretations of your Ascendant here.

Bye bye


I by chance found that many people think that if you have, for example, a 10 megapixel photo and the resize it and enlarge the resolution to the double of the pixels size you would get a 20 Megapixels photo.

Quote
Oh, to be among the elite who know better, take extensive surveys, and know many people.


I already know the right answer, and have already tested it myself, I ask this now here to see what you and others think and believe, and if you are aware of this or not.

Quote
You should know I am a swift and resourceful genius FWIW


If you do not knopw already the answer and want to test it here is the megapixels calculator to test it yourself. Double the size of the pixels shown and the multiply this two numbers and see if the final results is the double of the megapixels

Quote
You are a slow lazy imbecile and you should hail me for showing you the path to enlightenment!


Hi!
_____________________________________________________

http://web.archive.org/web/2021062908...rjadesign/
_____________________________________________________
  Details E-Mail
xirja
Idididoll Forcabbage

Posts: 1698
Filters: 8
Sorry everyone, I just got back from the doctors and they said that I have passive aggresive disorder. Please feel bad for me and know that I'm going to follow their advice and sing Lalalala while disregarding others advice, continue to post as many bad examples of others work as possible, and go on at length about anything and everything, hoping that I can again win something like 4 lbs. of yak.

Oh, and every time I am inclined to verbally assault young androgynous cyborgs in the bowels of Langley with ADHD, I was advised to say 'I love Ronald Reagan' five times.

smile:deer:
_____________________________________________________

http://web.archive.org/web/2021062908...rjadesign/
_____________________________________________________
  Details E-Mail

Join Our Community!

Filter Forge has a thriving, vibrant, knowledgeable user community. Feel free to join us and have fun!

33,712 Registered Users
+19 new in 30 days!

153,533 Posts
+31 new in 30 days!

15,348 Topics
+73 new in year!

Create an Account

Online Users Last minute:

25 unregistered users.