is there a way to batch pixelmath?

prefetch

Member
May 5, 2014
21
1
i need to run pixelmath on about 120 images to correct a recurring issue i have with my CCD.

is there a way to run pixelmath on a directory or somehow get pixelmath to run on a list of files?
 

bulrichl

PTeam Member
Nov 2, 2016
831
58
La Palma, Canary Islands
For simple cases there is no need for a script. Create an image container, load the images to be processed, set the output directory and input the new file name, e.g. "&filename;_mod.xisf" into the 'Output template' field.

Open PixelMath, input the expression. ($T is the placeholder for the currently processed image in the image container.)

Drag the blue triangle icon of the image container (New Image Container Instance) to the gray bar at the bottom of the PixelMath window.

Note that this will only succeed when the expression is the very same for all images in the image container. So there are limitations.

Bernd
 
  • Like
Reactions: raphi and prefetch

prefetch

Member
May 5, 2014
21
1
thanks bernd - that worked perfectly!

also, dave, yes they are monochrome images and i'm just "fixing" some frames from a KAF-50100 CCD. it's a "split" CCD so one side is uniformly different than the other side. for some reason calibration is not fixing this problem. from what i've researched, this issue has come up with other owners of this CCD, and the pixelmath fix is a quick way to solve the problem. i just needed a way to do it in bulk.
 

pfile

PTeam Member
Nov 23, 2009
5,625
105
that is an interesting sensor - it is two sensors "glued" together, right?
 

prefetch

Member
May 5, 2014
21
1
that is an interesting sensor - it is two sensors "glued" together, right?
yep, two sensors 'glued' together.

bernd, i'll try the overscan option and see if it helps. if it does, then that'll be easier, but this batch pixelmath trick works perfectly.
 
  • Like
Reactions: bulrichl

raphi

Member
Jul 15, 2020
14
5
I tried this and it works, sort of. After I dragged the triangle onto the pixelmath bar it opened all 40 pictures in the workspace and I can see that it did the math. But the images in the output directory I've specified (different one than the source) are all not modified, they still look the same as the original ones. What am I missing?
 

pfile

PTeam Member
Nov 23, 2009
5,625
105
in PixelMath make sure "replace target image" is selected. otherwise PM makes a new image with the modifications and puts it in the workspace. generally speaking when using ImageContainer the process being applied has to put it's result in the input image for ImageContainer to work right.
 
  • Like
Reactions: raphi

raphi

Member
Jul 15, 2020
14
5
Oh, I was so focused on the container settings that I totally forgot about the pixelmath setting. Thank you very much, it works now, this is an awesome feature ;).
 
  • Like
Reactions: pfile

mstriebeck

Well-known member
Nov 4, 2013
60
0
Hi @prefetch

Somebody pointed me to this thread as I am having the exact same issue with the 50100 chip...

It seems as if you got your calibration such that there is a constant quotient between all your images. For me, there is quiet a range, i.e. I can't correct all images by the same factor. How did you do your calibration?

Thanks
Mark