How to use Perlin Noise to create only ONE mountain?

Hi, I am working on a project that uses perlin noise to generate some terrain. The thing is, perlin noise is great to when it comes to smooth shapes, but I need only one. In other words, this is a normal output from perlin noise, but I need only ONE simple “Mountain/Hill”, like this . I need my shapes to be random with the smooth transitions of perlin noise but also pretty simple. I need to be sure that I won’t get any height along the borders of the image and so on. This is a very important project and I would immensly appreciate any amount of help I can get. Thank you and have a Great Day!

Here is the code I took from an online tutorial:

using System.Collections;
using UnityEngine;

public class PerlinNoise : MonoBehaviour
{
    private static int width = 256;
    private static int height = 128;
    public float scale = 20f;

    public float offsetX = 100f;
    public float offsetY = 100f;
    private int xcont = 0, ycont = 0;
    public float[,] array = new float[width,height];

    private void Start()
    {
        offsetX = Random.Range(0f, 99999f);
        offsetY = Random.Range(0f, 99999f);
    }
    void Update()
    {
        Renderer renderer = GetComponent<Renderer>();
        renderer.material.mainTexture = GenerateTexture();
    }

    

    Texture2D GenerateTexture()
    {
        Texture2D texture = new Texture2D(width, height);

        //GENERATE A PERLIN NOISE MAP FOR THE TEXTURE

        for(int x=0;x<width;x++)
        {
            for(int y=0;y<height;y++)
            {
                Color color = CalculateColor(x,y);
                texture.SetPixel(x, y, color);
            }
        }

        texture.Apply();

        return texture;
    }

    Color CalculateColor(int x, int y)
    {
        float xCoord = (float)x / width * scale + offsetX;
        float yCoord = (float)y / height * scale + offsetY;
        float sample = Mathf.PerlinNoise(xCoord,yCoord);
        if (xcont == width - 1)
        {
            xcont = 0;
            ycont++;
        } 
        else xcont++;

        if (ycont == height - 1 ) ycont = 0;

        array[xcont,ycont] = sample;
        return new Color(sample, sample, sample);
    }
}

@beastsOnly, there are several ways you can approach this, and this is off the top of my head having created a mountain generator in the past based on Sebastian Lague’s work (see his excellent Land Mass Generation YouTube series.)

The overall idea for both suggestions here is to use the Perlin output as modifiers for base values that you generate or read from other sources.

  1. One is to just set some function that generates zero at the edges and increases the further away you are (the closer to the center of your map). For example, half of the Sine function will do that, so Sin(0) - Sin(180) will give you a hump in both x and y and then use that to multiply by your Perlin values by (or some factor of your Perlin value depending on how much you want to perturb the base Sine values returned). You just need to map your Map size min and max to 0 through 180 for both x and y. The Sine function will give you a noticeable hump, so you might want to stretch it out, or look at some other functions ( see #4 below).

  2. Probably the easiest is you could create an base shape for your mountains as a grayscale texture, in say, photoshop, and then read through that and use the Perlin output as a multiplier for each pixel in the texture to produce the final texture2D color. If you make sure the edge values are zero (black) and grow smoothly to white (the highest points) the edges would be at the base level. However using this start with the same overall shape.

  3. Instead of working with a second bitmap you use an animation curve, or multiple animation curves, to provide the base values, and then apply Perlin as in step 1. This approach would again produce more predictable shapes.

  4. You could write your own LERP to interpolate between several values or use a Bezier or Spline functions - essentially create a curve dynamically - that you could use with randomly generated values and you apply to x and y to get the base heights that you then apply your Perlin to. Again you just need to make sure that the start and end values are zero. Bezier and Spline functions would be maybe nicer looking because they would provide smooth curves, whereas LERP is going to create more sharp edged base slope values.

For any of the suggestions above there is nothing that says you can’t use different functions for each dimension - so the base values don’t have to be symmetrical.

None of that should not be too difficult to implement.