wizark Posted May 27, 2021 Posted May 27, 2021 The lens profile for Sigma 35mm DG DN is not available at lensfun, and the lens is not currently being calibrated. Where else could I find its lens profile? Or is there ways to download adobe's lens profile and use it in Affinity Photo? Thanks! Quote
walt.farrell Posted May 27, 2021 Posted May 27, 2021 Welcome to the Serif Affinity forums. I don't think they're available anywhere else. But there are instructions on the Lensfun site for how to perform the profiling yourself, if I remember correctly. And that data should be usable in Photo. You could then submit your profiling info to them to help others. Quote -- Walt Designer, Photo, and Publisher V1 and V2 at latest retail and beta releases PC: Desktop: Windows 11 Pro 23H2, 64GB memory, AMD Ryzen 9 5900 12-Core @ 3.00 GHz, NVIDIA GeForce RTX 3090 Laptop: Windows 11 Pro 23H2, 32GB memory, Intel Core i7-10750H @ 2.60GHz, Intel UHD Graphics Comet Lake GT2 and NVIDIA GeForce RTX 3070 Laptop GPU. Laptop 2: Windows 11 Pro 24H2, 16GB memory, Snapdragon(R) X Elite - X1E80100 - Qualcomm(R) Oryon(TM) 12 Core CPU 4.01 GHz, Qualcomm(R) Adreno(TM) X1-85 GPU iPad: iPad Pro M1, 12.9": iPadOS 18.3.1, Apple Pencil 2, Magic Keyboard Mac: 2023 M2 MacBook Air 15", 16GB memory, macOS Sequoia 15.0.1
David in Яuislip Posted May 27, 2021 Posted May 27, 2021 (edited) 4 hours ago, wizark said: Sigma 35mm DG DN is not available at lensfun You don't mention the lens max aperture however there are a couple available in Photo 1.9.2. Why not try them and see if there is an acceptable improvement over no correction? Oops, apologies, I've just re-read the title Edited May 27, 2021 by David in Яuislip Oops Quote Microsoft Windows 11 Home, Intel i7-1360P 2.20 GHz, 32 GB RAM, 1TB SSD, Intel Iris Xe Affinity Photo - 24/05/20, Affinity Publisher - 06/12/20, KTM Superduke - 27/09/10
wizark Posted May 28, 2021 Author Posted May 28, 2021 Thanks for your help! I do find the profile for 35mm F1.2 DG DN is good enough for the distortion correction. Btw, I noticed chromatic aberration and Vignetting parameter were included in lensfun, do affinity photo uses these parameter? Quote
wizark Posted May 28, 2021 Author Posted May 28, 2021 20 hours ago, walt.farrell said: Welcome to the Serif Affinity forums. I don't think they're available anywhere else. But there are instructions on the Lensfun site for how to perform the profiling yourself, if I remember correctly. And that data should be usable in Photo. You could then submit your profiling info to them to help others. The Lensfun's test require some other applications and python installed, and it's a little complicated. But thanks anyway! Hope somehow future updates will add the lens. It would be great if we could use the same library as Adobe's. Quote
David in Яuislip Posted May 28, 2021 Posted May 28, 2021 39 minutes ago, wizark said: chromatic aberration and Vignetting parameter were included in lensfun, do affinity photo uses these parameter? I have no idea exactly what parameters are used by Photo but you can load your own version of the correction file into the Affinity lens profile folder and experiment, this will supersede the built in correction. Restart the program after loading or modifying this file. Open the attached Sigma35F1.2.xml with a text editor and note that I have commented out (<!-- stuff -->) the tca correction and the vignetting corrections wider than f2, edit to taste. Lens correction is a bit of a dark art. Some lenses have the correction data in the metadata, the lensfun initiative is most noble but I rely on PhotoLab which I regard as superb Sigma35F1.2.xml Quote Microsoft Windows 11 Home, Intel i7-1360P 2.20 GHz, 32 GB RAM, 1TB SSD, Intel Iris Xe Affinity Photo - 24/05/20, Affinity Publisher - 06/12/20, KTM Superduke - 27/09/10
kirkt Posted May 29, 2021 Posted May 29, 2021 FYI - the free pano stitcher called Hugin comes with a Lens Calibration utility that essentially automates the manual process of finding horizontal lines and using Hugin to determine the a, b and c coefficients of the lensfun lens correction model. http://hugin.sourceforge.net Kirk walt.farrell 1 Quote
kirkt Posted May 29, 2021 Posted May 29, 2021 I went through the process of creating a custom lens profile for one of my lenses, a perspective correction lens (the Leica PC-Super-Angulon-R 1:2.8/28). It is actually pretty straightforward. In my case, because the lens does not communicate with the camera body (it is an R mount lens on a Leica SL2 via a Novoflex R to L mount adapter) I had to inject some lens and aperture metadata into the DNG file to get the right stuff in place for AP to recognize the lens and apply the custom profile. The basic idea is this - for a prime lens (fixed focal length) you need to shoot one image that has well-defined horizontal (and vertical if you want) lines in the image. They need to be coplanar and they need to go across the entire image field. You want the lines to make the lens distortion obvious and you want them at the edges of the image (top and bottom) as well as across the middle. An ideal image is a grid like you might see on a modern building - you also need to make sure that the lines are truly straight, so older buildings may not be the best candidate. The lines need to be in the same plane (coplanar) across the entire image field, again making a modern building a good candidate. Once you have your image, you open it in Hugin or similar application that is typically used to stitch panoramic images. These applications all use optimization parameters that include the lens distortion model used by LensFun (the ptlens model - the "pt" is an abbreviation for panotools or Panorama Tools, the granddaddy of pano stitching tools). If you are familiar with making an panoramic image with Hugin, or PTGui or any of these applications, you typically import a set of images, set up a bunch of "control points" across the image set that tells the stitcher how the images should fit together, and then let the application correct for distortion, alignment, etc. and stitch and blend a panorama as the final output. In our case, we are going to abuse Hugin to get the information we need to make our own LensFun library entry. The LensFun ptlens model requires knowledge of three parameters, known as "a," "b," and "c." Hugin will give us these parameters if we ask nicely. Once you bring your single image into Hugin, you will place control points along lines that span the image, and then ask Hugin to optimize the image so that those lines become straight lines in the final output. You are basically asking Hugin to determine the a, b and c values that remove the distortion that the lens is causing to make those straight lines not so straight (like pincushion or barrel distortion, mustache distortion, etc). Once Hugin does the optimization, you can enter those a, b and c values into the LensFun database xml file that you are customizing for use with AP. After you place that customized LensFun xml file in the proper directory (the AP Preferences will open the directory for you as shown in a previous post above) and restart AP, if the EXIF data in your image matches the customized database entry properly, you should be able to apply your custom profile. What is even better is that you can use a raw converter outside of AP (if you prefer not to use the AP Develop persona to convert your raw images) and bring the resulting RGB image into AP - then, use the Develop persona to apply the lens correction to the RGB file! Sweet. I will try to put together a detailed tutorial here to go through the whole process, including writing EXIF data to a DNG file for lenses that do not do so automatically. Have fun rolling your own lens profiles! Kirk I did not use the attached image as my reference image - this is an old building with a non-coplanar facade. However, I used this image as an example to evaluate the correction. lepr 1 Quote
kirkt Posted May 29, 2021 Posted May 29, 2021 To get prepared, consider installing and learning a little bit about two free tools used in the process: 1) EXIFTool: https://exiftool.org 2) Hugin: http://hugin.sourceforge.net Kirk Quote
kirkt Posted May 29, 2021 Posted May 29, 2021 In the attached example, I used an external raw converter (Raw Photo Processor, aka RPP) and brought the resulting conversion into AP as a 16bit TIFF. I then used the Develop persona to apply the custom lens profile (see screenshot). Because the EXIF data are all consistent between the image file and the customized LensFun database, AP automatically finds the lens profile and applies it. Note that "0%" correction means the base amount, not zero lens correction. Changing to more positive or negative values amplifies or inverts the correction beyond the baseline. Kirk Quote
kirkt Posted May 29, 2021 Posted May 29, 2021 Here are some resources to check out as well: https://wilson.bronger.org/lens_calibration_tutorial/ Kirk Quote
kirkt Posted May 29, 2021 Posted May 29, 2021 I went out today and shot a proper building as a reference for the PC-Super-Angulon-R. This building is pretty perfect for the job and permits a good deal of sampling of the lines in the image. Attached is the before and after of the shot. Apparently I had the axis of the lens slightly tilted and slightly skewed off of perpendicular to the face of the building, which is also easily corrected in the Develop persona with the Vertical and Horizontal controls. Sweet. Kirk Quote
kirkt Posted May 29, 2021 Posted May 29, 2021 Here are some screenshots of the Hugin interface and the lens optimization results window. Also, some behind-the-scenes shots! Kirk Quote
kirkt Posted July 13, 2021 Posted July 13, 2021 As an FYI - the current beta (v 1.10) of AP permits the use of ACR lens profiles. Copy them from the ACR Lens Profiles folder on your machine into the location where you would place custom lensfun files (you can have AP open this folder on your machine via the General Preferences). kirk Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.