Cairolatex terminal produces bitmap output - latex

I am using gnuplottex in Overleaf to write a document using the IEEETran document style.
When I plot filledcurves the result kind of bad as it seems not to be in a vector graphics format; thus getting pixelated upon zooming into the figure.
Additionaly, some weird white boxes are floating around hideing parts of a label.
I developed the figure locally on my machine using the cairopdf terminal and Gnuplot 5.4.
The first picture show the resulting pdf of of Latex using the cairolatex terminal.
The second picture shows a very deep zoom in the test pdf done with the cairopdf terminal where everything looks good.
set style fill transparent solid 0.35 noborder
plot for[i=1:num_states] normal(x, word(means, i), word(std, i)) notitle with filledcurves y1=0
What is going on? I read that epslatex has some trouble with transparency is that here also the case?

The PostScript language itself (including *.eps) does not support transparency or alpha-channel colors. So no *.ps or *.eps file can portray transparent/translucent areas properly. At best it can be approximated by using some intermediate representation that does handle alpha channels and then translating the final resulting blended colors to PostScript, but that means later color balance adjustments made during viewing or printing will not preserve the correct balance in the blended areas.
There should be no problem with pdf. I don't know what caused that partial white rectangle. Maybe if you show a more complete script that created the figure?
Edited:
Using set terminal cairolatex pdf in gnuplot should solve the pixelation and transparency issues. You can create a new question if the unwanted white rectangles persist.

Related

Midas depth map: strange lines on sharp edge

I'm using Hugging Face's DPT large to compute depth map.
Here is an example of my problem:
(credit: museum of GenĂªve)
The depth map contains some little white lines just above the mountains in the background.
How can I avoid them ?
btw: I have cloned the repo and it works well on my local computer, so I have access to the code. I can make pre/post-processing. But as non-specialist I cannot patch Midas itself.
EDIT: I'm using Midas exactly as in the example: https://huggingface.co/spaces/akhaliq/DPT-Large/blob/main/app.py By the way, the effect I describe is visible in the offical demo.
EDIT: when I feed the extractor with the original 1148x790 image, the issue does not appears. It appears with a resized image 600x413. Thus a solution could be to only use non resized images.
Answer to myself.
It turns out that the issue disappears with:
Using the model "DPT_BEiT_L_512"
transform = midas_transforms.dpt_transform
prediction = torch.nn.functional.interpolate(
prediction.unsqueeze(1),
size=img.shape[:2],
mode="bilinear", # <--- instead of bicubic
antialias=True,
align_corners=True,

imagemagick cropping image creates jagged edges or saw-tooth shapes

The above pic (looks like zoomed one ) is from first level conversion from 1.Ai file 1_cropped.AI file what I get after cropping. I don't do resize during cropping it gets automatically resized.
I am trying crop an image, Seems without +repage imagemagick unable to crop. The problem is a simple crop created the jagged lines as you can see from the snapshot taken from a portion of image.
How to remove this. Some where in SOF post I found a recommendation to use "Gaussian blur" but didn't find a proper command to do the same. Many thanks! I am doing just the crop and no resizing.
Original : Due to copyright can't show the entire image. But below is one section:
Looking into : http://www.imagemagick.org/Usage/antialiasing/ now but unable to smoothe the 'stair case' or 'jaggies' so far.
UPDATE from the comments:
Yes the input is AI and output is almost all format AI/SVG/PNG/GIF/JPEG/BMP. So for smaller resolution files such as png/GIF I don't get that jagged shapes I I tried turning on anti-aliasing , blurring and guassian-bluring but no luck. I think the repaging zooms the image which I don't need, is it possible to set the canvas somehow so the original resolution is kept intact when converting from AI to AI? Yes initially I convert AI to AI after cropping and than feed the converted AI for further processing. The stair-stepping appears from first level AI to AI file conversion itself.

Draw a horizontal line with just a click using Adobe Photoshop

I am looking to find a way to draw a horizontal line of full page width on a PNG file with a single click. Thing is I am trying to draw a lot of lines and if I've to click and drag it becomes extremely inefficient.
I am working on a Windows platform.
How can I achieve this using Adobe Photoshop? Any ideas?
Thanks
Here is a sample of page. Green lines are the ones drawn.
Draw a line as you want it on a big new canva. Trim the image when done. Then Create a brush from the open file (edit > define brush preset), save it, done. Now you can use yout line as a brush.

Firemonkey drawing on bitmap without interpolation

I am using the canvas draw functions drawrect and filltext to draw onto a Tbitmap but I don't want the results antialiased. Anyone know how to do that ?
Working with OSX and Delphi XE3 (but have XE4 and XE5 if needed)
Is the problem:
the bitmap you create seems to have anti-aliasing present in the data?
or have you got a good bitmap and want to disable anti-aliasing in the viewer/display?
If it is the former, have you checked that the anti-aliasing is actually present in the bitmap, and not introduced by your viewer?
In the past I've found it useful to draw a black-on-white test pattern, and display the image at 1:1 scale. Irfanview is a nice tool for viewing at 'true' scale. Then use a loupe/peak/lens to get a close-up of the actual pixels.
Black-on-white test patterns are particularly good since you should be able to see (hopefully) that the R,G and B sub-pixels are all equally illuminated when there is no anti-aliassing present. If you draw a black-on white pattern and you get solitary bright sub-pixels then you've definitely got anti-aliassing (or some other form of corruption!).
My experience has been that image viewers often do interpolation for you, and it can be tricky to see what is going on unless you look at the actual bitmap data or have a close-up look at the unscaled image...
Hi in the drawBitmap method you need to set HighSpeed parameter to "True", in the sample below:
NewBitmap.Canvas.DrawBitmap(SmallBmp, RectF(0, 0, SmallBmp.Width, SmallBmp.Height), RectF(0, 0, NewBitmap.Width, NewBitmap.Height), 1,**True**);
rgds
Ivan

How to control the pencil in gimp

I'm writing a script in gimp and I want to place several random points on the screen. I placed in my (python) script the two following lines
gimp.pdb.gimp_context_set_brush_size(5.0)
gimp.pdb.gimp_pencil(drawable,2,p)
But this didn't have the desired effect, or any effect.
Also, I don't know how to set the brush (the small icon next to the brush size in the gui).
Finally, is there a way to get a list of pencil dots on the current layer?

Resources