This forum has been archived. All content is frozen. Please use KDE Discuss instead.

How would you rescale without interpolation?

Tags: None
(comma "," separated)
User avatar
CorrosiveTruths
Registered Member
Posts
87
Karma
0
OS
A quick browse of the ffmpeg and mlt documentation didn't help so much when I tried to do this outside of kdenlive, but I figure there must be a way to do it.

Any suggestions?

So just in case you call it something else, I'm talking about when you take an image and double the size in both directions so that each pixel of the original image becomes 4 pixels in the new one with the same values. You can see an example of what I want here, which ImageMagick refers to as scale.
User avatar
ttguy
Moderator
Posts
1152
Karma
6
OS
If we are talking images then use The Gimp

Image>Scale Image - Interpolation = None
User avatar
CorrosiveTruths
Registered Member
Posts
87
Karma
0
OS
ttguy wrote:If we are talking images then use The Gimp

Image>Scale Image - Interpolation = None

That, but for video in kdenlive is what I'm after. I suppose I could use the gimp-gap stuff, but yes, I want to do this with movies instead, that's why I was looking at ffmpeg and mlt as I want to do it in kdenlive.
vpinon
KDE Developer
Posts
708
Karma
6
OS
ffmpeg scale filter doc points to sws doc for flags argument, which would let you choose ‘neighbor’ algorithm.
Never tried but I think this is the track to follow...
User avatar
qubodup
Registered Member
Posts
142
Karma
0
I did a quick comparison of two scaling methods and one effect:
http://imgur.com/a/7oy2F
You can get the full-size images by right-clicking and selecting "open image in new tab"

1. The Composite transition appears to not use interpolation.
Warning! Using Composite causes some serious memory abuse on my system just by previewing. Didn't matter whether the blue icons were set to opaque or composite.

2. The Crop, Scale and Position effect appears to be using interpolation.

3. If you simply want the visual effect, the Pixelize effect might be a compromise.

Speaking of scaling manually, I have a related question: when I put a 640x480 clip in a 1920x1080 project, it gets scaled and letterboxed automatically (unless blue icon composite is on, then there's no letterboxing). Is it possible to have a clip retain its resolution when getting placed in a project of a different resolution? (This was the second-biggest confusion for me when I first started using Kdenlive, right after why transparent images weren't transparent. :) )

Last edited by qubodup on Thu Nov 12, 2015 10:58 am, edited 1 time in total.
User avatar
CorrosiveTruths
Registered Member
Posts
87
Karma
0
OS
vpinon wrote:ffmpeg scale filter doc points to sws doc for flags argument, which would let you choose ‘neighbor’ algorithm.
Never tried but I think this is the track to follow...

Thank you, I was aware of sws_flags, but I don't know what all the algorithms mean, looking at nearest neighbour, that does sound right. I'll give that a go.

Wish me luck.
User avatar
CorrosiveTruths
Registered Member
Posts
87
Karma
0
OS
qubodup wrote:I did a quick comparison of two scaling methods and one effect:
http://imgur.com/a/7oy2F
You can get the full-size images by right-clicking and selecting "open image in new tab"

1. The Composite transition appears to not use interpolation.
Warning! Using Composite causes some serious memory abuse on my system just by previewing. Didn't matter whether the blue icons were set to opaque or composite.

2. The Crop, Scale and Position effect appears to be using interpolation.

3. If you simply want the visual effect, the Pixelize effect might be a compromise.

Speaking of scaling manually, I have a related question: when I put a 640x480 clip in a 1920x1080 project, it gets scaled and letterboxed automatically (unless blue icon composite is on, then there's no letterboxing). Is it possible to have a clip retain its resolution when getting placed in a project of a different resolution? (This was the second-biggest confusion for me when I first started using Kdenlive, right after why transparent images weren't transparent. :) )

Those are also very good ideas, especially the composite one which I may try if ffmpeg sws-flags doesn't work. Pixelise I'm ... not sure about, maybe? I can't think why that wouldn't work, inefficient for sure, but that might not matter.

If you drop a 640 clip and use an affine transition, there is an adjust to original size underneath the X Y W H bit. I use that once in a while, but I'm usually after what kdenlive does by default, scaled to fit.
TheDiveO
Registered Member
Posts
595
Karma
3
OS
There should be three scaling buttons in either the affine or composite effects, or both. One button is for scale to width (of project), one for scale to height (of project), one for 1:1 (original size of source clip). If my memory serves me right.
User avatar
CorrosiveTruths
Registered Member
Posts
87
Karma
0
OS
vpinon wrote:ffmpeg scale filter doc points to sws doc for flags argument, which would let you choose ‘neighbor’ algorithm.
Never tried but I think this is the track to follow...

This worked for ffmpeg, but not as a render parameter. However, the files produced are three times the size at the same crf (I was hoping it would be comparable), so I can't use it anyway :/
Tooniis
Registered Member
Posts
1
Karma
0
OS
Did anyone find a solution to this yet?


Bookmarks



Who is online

Registered users: Bing [Bot], Google [Bot], lockheed, Sogou [Bot]