Replacing pictures

Ask for help and post your question on how to use XnView Classic.

Moderators: XnTriq, helmut, xnview

Post Reply
Magistermagic
Posts: 3
Joined: Thu Jul 28, 2016 11:42 pm

Replacing pictures

Post by Magistermagic »

Hello,
I am new here, looking for some help with xnview 2.35.

I have saved a video as: 9155 jpg files and i want to change about 3625 pictures. After that i will make a new video from it.

I can't seem to find anything to change the pictures at once, because i want them all changed by one and the same picture and they are not in the same order. If i have to do this one by one it takes to much effort, then i will dismiss that task.

Is there any way to do that? or maybe a script to do that?
User avatar
xnview
Author of XnView
Posts: 43444
Joined: Mon Oct 13, 2003 7:31 am
Location: France
Contact:

Re: Replacing pictures

Post by xnview »

you wan to change picture in a video file?
Pierre.
Magistermagic
Posts: 3
Joined: Thu Jul 28, 2016 11:42 pm

Re: Replacing pictures

Post by Magistermagic »

i already saved the video as *.jpg files. The 3625 jpg's that i want to change are in a different map now and i want them all changed with 1 particulary picture. After that i will remake a video with all the correct files.
User avatar
XnTriq
Moderator & Librarian
Posts: 6336
Joined: Sun Sep 25, 2005 3:00 am
Location: Ref Desk

Re: Replacing pictures

Post by XnTriq »

Let's pretend your exported video frames have the following name pattern:
  • X:\export\frame_0001.jpg
  • X:\export\frame_0002.jpg
  • X:\export\frame_9155.jpg
Copy the frame that's intended to replace the 3625 others to a new folder (e.g. X:\temp\) and name it frame.jpg.
Running the following batch file…
[color=green]X:\temp\replicate.bat[/color] wrote:

Code: Select all

@echo off

for /l %%i in (1,1,9155) do call :docopy %%i
goto end

:docopy
set numero=000%1
set numero=%numero:~-4%

copy frame.jpg frame_%numero%.jpg

:end
… will leave you with a set of 9155 identical copies of frame.jpg.
Overwrite the 3625 frames in X:\export\ with their counterparts in X:\temp\.
cday
XnThusiast
Posts: 3976
Joined: Sun Apr 29, 2012 9:45 am
Location: Cheltenham, U.K.

Re: Replacing pictures

Post by cday »

Magistermagic wrote:I have saved a video as: 9155 jpg files and i want to change about 3625 pictures. After that i will make a new video from it.

I can't seem to find anything to change the pictures at once, because i want them all changed by one and the same picture and they are not in the same order. If i have to do this one by one it takes to much effort, then i will dismiss that task.

Is there any way to do that? or maybe a script to do that?
This is an unusual request, and it isn't clear whether the files to be changed are consecutively numbered or not, which might be a consideration for some possible solutions. I can see several possible approaches.

But hold fire chaps...

I think this can actually be done very easily using XnView software :D...

Solution: use Batch convert to watermark the images in the folder of images to be changed with the replacement image:

For example, using XnConvert:

Before.png
After.png
As the pixel dimensions of the video frames will all be the same, the desired image is in effect substituted for the original images.
User avatar
XnTriq
Moderator & Librarian
Posts: 6336
Joined: Sun Sep 25, 2005 3:00 am
Location: Ref Desk

Re: Replacing pictures

Post by XnTriq »

cday wrote:Solution: use Batch convert to watermark the images in the folder of images to be changed with the replacement image:
:-D Hah, very clever!
Magistermagic
Posts: 3
Joined: Thu Jul 28, 2016 11:42 pm

Re: Replacing pictures

Post by Magistermagic »

nice, this worked, especially because they where not equal numbered !!!
Thank you very much !!!
Post Reply